The traditional snake game with some customizations. Created using Assembly Language
Project Partner :
Samra Fakhar
The following functionalities have been implemented:
- A snake that automatically moves left, right, up and down on the screen.
- Initial size of snake is 20 characters with head of the snake represented by a different character as compared to its body.
- The arrow keys are used to determine the direction of snake.
- If the snake’s head touches the border of screen the players loses one life. Initially the player has three lives. After losing all three lives the game is over.
- If the snake eats a fruit the size of snake is increased by four characters.
- If the snake does not eat the fruit, the fruit remains on the screen.
- After the fruit is eaten by the snake, the next fruit immediately appears on a random location on the screen.
- Maximum size of snake can be 240 characters.
- If the snake does not reach the maximum size in 4 minutes one life of player will end.
- If the snake reaches the maximum size in 4 minutes the player earns some points and moves to the next level
- After every 20 seconds the speed of snake is twice as the previous speed.
- If the snake touches itself one life of player will end.
- There are 3 levels which are shown in the screenshots of the running application below
- There is a dangerous fruit (the one in black that is blinking). If the snake eats this fruit, the player loses some points
To run the asm file, you need Dosbox, nasm and AFD installed.
Open Dosbox and navigate to the folder where you have nasm, afd and the snake.asm file. Use the following command to create the output file
nasm snake.asm -o snake.com
Then use the following command to run the application
snake.com
Below is the default home page of the game. The UI is kept simple but colourful to keep the user's interest peaked.
On the top right, we have shown the total lives and the current lives of the user. On the top left, we show the score and level. In the center, we show the size of the snake and when the game begins, a timer is also shown here.
Here we have the first level of the game. There are no hurdles in this level because it is the easiest one. The player needs to eat fruit to get to the size 240 after which the second level appears.
Level 2 of the game is shown below:
The last level is shown below:
If you complete the last level, then you will have won the game. If you lose all the lives in between, you lose.
Hope you enjoy playing!