Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - russjr08

Pages: [1]
1
Graphics / Re: Can't seem to get sf::Sprite to change positions...
« on: November 08, 2014, 07:54:45 pm »
Currently, the only time it's being set is in the Player's constructor.

2
Hello! I appear to have gotten stuck here... I have a player class with a sprite member, and it won't seem to change it's position.

Entity.h / Player.h -> http://pastebin.com/yQhDDPTi
Player.cpp -> http://pastebin.com/rmsy8Gxk

I'm calling my sprite's setPosition, and am passing an instance of sf::Vector2f to it.. Nothing happens. I've even tried calling setPosition(pos.x, pos.y) manually and it doesn't seem to work either. When I debug my render method, I see that my internal position is indeed correct, however looking into the entity's sprite variable, I see 'sf::Transformable', with a position member, and it has 0, 0 as the coordinates.. (http://prntscr.com/54c290) If I manually change these, the next render call overrides it with 0, 0 again...

Back in my game class, I can draw a CircleShape and manipulate it's position just fine..

I'm so stumped, I've worked with SFML before and it's always been fantastic for me! I'm sure there's something I overlooked, but I can't find it, and I've compared it with a previous game I've made...


I appreciate any help that you guys can give me :)




Edit: So apparently I can modify the sprite's position when I made it a pointer instead of a regular object... I have *no* clue why that works. But it works, so I guess I'm happy.

Pages: [1]
anything