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 - Theom

Pages: [1]
1
Graphics / Sprite does not move left or up
« on: October 10, 2011, 11:12:20 pm »
It worked. Thank you very much.

2
Graphics / Sprite does not move left or up
« on: October 10, 2011, 10:52:46 pm »
I tried both using SetPosition and Move but both had the same result, when I can move the sprite down and right, that is I can only add to the position not subtract.

The relevant code would be:
Code: [Select]

case sf::Event::KeyPressed:
                switch(Event.Key.Code)
                {
                case(sf::Keyboard::Up):
                    py-=2;
                case(sf::Keyboard::Down):
                    py+=2;
                case(sf::Keyboard::Left):
                    px-=2;
                case(sf::Keyboard::Right):
                    px+=2;
                }
...
                pyr.SetPosition(px, py);

Pages: [1]