SFML community forums
Help => General => Topic started by: Stormboy on April 04, 2014, 06:01:16 pm
-
Hi,
I'm planning to make a snake game and I've pretty much figured out most of the game except one thing: updating the snake's body blocks' position.
Take this scenario for example:
The snake is moving left. User presses the UP key and now the head block starts moving up. Now how should the body blocks' positions (x & y) be updated?
Thanks. :D
-
The head is the only thing that will move to a new position depending on user input. All body segments simply move to the position of the segment that is in front of them.
-
The head is the only thing that will move to a new position depending on user input. All body segments simply move to the position of the segment that is in front of them.
Oh never thought of it that way. Thanks again :D
Another question if you don't mind: Which would be the best container for the blocks?
-
Check this out whenever you have to decide what kind of container you need:
http://i.imgur.com/OxUhWfm.png
-
Check this out whenever you have to decide what kind of container you need:
http://i.imgur.com/OxUhWfm.png
Thanks for that :).
-
Also this (http://www.cplusplus.com/reference/stl/), if you wan't more detailed information about the different container of STL.