Skip to content

striver79/Snake

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Game Description:

Press w/a/s/d to control the snake. If the snake eats an apple, it gains 100 scores. It the snake hits wall or itself, and has no extra lives, it dies.

Press p to pause the game. If the game is paused, press p to resume the game and keep the snake’s direction as before the pause, or press w/a/s/d to resume the game and change the snake’s direction.

Press r to restart the game at any time (i.e. while playing, paused, and/or dead).

Default FPS = 60
Default speed = 5


Enhancements:

I have added two power-ups into the game.

1. Golden Apple - If the snake eats a golden apple, it gains an extra life. The possibility of generating a golden apple is 10%.
2. Purple Apple - If the snake eats a purple apple, its speed decreases by 1 (Minimum = 1). If player restarts the game, snake’s speed is reset to default (or the given speed from command line). The possibility of generating a purple apple is 6%.

For easier test of the special apples, you can keep press r until they show.

I have also drawn a snake and apples with fillrectangle, which I am not sure if they can be counted as texture graphics.


Development Environment:

macOS Sierra
version 10.12.2

About

Snake game with C++ & X11

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 99.0%
  • Makefile 1.0%