Making the snake die
Tired of playing with "God Mode" on? Ok, let's make the snake die.
The idea: The snake will die if one of these conditions is verified:
- The snake's head hits a wall
- The snake's head hits any part of the snake's body
- The snake's head leaves the stage
In some versions of the game, when the snake leaves the stage crossing through one boundary, it appears on the opposite side, but in this game the snake cannot leave the stage.
Also, the snake has only one life, so when the snake dies, it's game over.
The development: Each time the snake moves, we must check if the head is in the same tile occupied by an obstacle or by a piece of the snake's body. Also, we must check if the head is in the stage.
But first, let's see what should happen ...