15-01-2013, 04:41 PM
The Design and Implementation of the Snake Game
The Design and Implementation.ppt (Size: 402 KB / Downloads: 77)
The Snake Game
A popular video game released during the early 1970s
Features a snake roaming around on a bordered plane, picking up food, trying to avoid hitting its own tail.
The user controls the direction of the snake's head and the snake's body follows .
The Game Session
Initialize the game environment.
Create the necessary objects, e.g. snakes, food
While the game is running:
for each of the snakes:
move the snake one square ahead
check if it has eaten food and if it has crashed.
if crash and it is the player’s snake, end the game session.
generate food particles if the food particles on the board is less than the specified amount.
Language
I chose Java due to the following reasons:
Familiarity
Library availability
Object oriented
Language Simplicity
Source Code Statistics
General Statistics:
Total size of the code base: 1486 loc (lines of code, comments included).
Implementation was done in 3 days’ time (documentation excluded).