SFML community forums
Help => General => Topic started by: Greentoast on May 16, 2015, 10:24:39 pm
-
So the title is pretty self explanatory my circle shape wont move when I click 'D' I don't understand what I did wrong so some explanations would be great and would be really appreciated !
http://pastebin.com/x3yxVNfQ
-
You appear to be redefining the circle shapes every loop, and this therefore resets it. You should declare the shapes before your game loop and then move within the game loop. This way they aren't reset every loop.
EDIT: You also draw the shapes before moving them so therefore they won't move at all as they are then reset back to their original position before being drawn again.
-
That worked to a degree but now it multiplies it seems to be making new copies of the circle each time it moves.
http://pastebin.com/LMKeadUF
-
You missed out window.clear(). You should put it in front of the window.draw().
-
Alright thanks,
Now I have a pretty slick moving circle. Now for the first update to the the critically acclaimed game 'Circle'.
WASD controls :)
But seriously thanks for helping 8).