- Joined
- Dec 30, 2012
- Messages
- 196
- Reaction score
- 176
- First Language
- English
- Primarily Uses
- N/A
I'm using this script for a snake mini game, which can be found here.
For those of you who know how the game snake is like, if the snake touches its own body, it's game over. But for this script in particular, the game ends if the player presses a backward button. So if the snake is moving right and the player accidentally clicks the 'left' button, it's game over. Which, should not happen since the snake did NOT touch its own body. Also, it's just not how the game should be. The same goes for 'up' and 'down' commands as well. It's game over if the player clicks the direction button opposite the way the snake is headed. Is there a way to prevent this from happening?
For those of you who know how the game snake is like, if the snake touches its own body, it's game over. But for this script in particular, the game ends if the player presses a backward button. So if the snake is moving right and the player accidentally clicks the 'left' button, it's game over. Which, should not happen since the snake did NOT touch its own body. Also, it's just not how the game should be. The same goes for 'up' and 'down' commands as well. It's game over if the player clicks the direction button opposite the way the snake is headed. Is there a way to prevent this from happening?
