- SFML Game Development By Example
- Raimondas Pupius
- 224字
- 2021-07-23 14:55:07
Introducing snake
If right now you're imagining building a game with Solid Snake wearing his trademark bandana, we're not quite there yet, although the eagerness to do so is understandable. However, if you pictured something like the following, you're right on point:

First published by Gremlin in 1976 under the name "Blockade", the snake concept is one of the most famous game types of all time. Countless ports have been written for this type of mechanic, such as Surround by Atari in 1978 and Worm by Peter Trefonas. Pretty much any platform that crosses one's mind has a port of snake on it, even including the early monochrome Nokia phones, such as the 3310 and 6110. The graphics changed from port to port and improved with time. However, the main idea and the rules remained the same ever since its humble beginnings:
- The snake can move in four total directions: up, down, left, and right
- Eating an apple makes the snake grow in length
- You cannot touch the walls or your own body, otherwise the game is over
Other things may vary depending on which version of the game you play, such as the score you receive for eating an apple, the amount of lives you have, the speed at which the snake moves, the size of the playing field, obstacles, and so on.