Skip to content

AshleyXM/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnakeGame

A mini snake game

demo.mp4

Functionality

  • Players use WASD to control the direction.
  • The snake stays still at the board center initially. Only after players press a key to change the direction can the snake start to move.
  • Snake cannot move reversely, for example, the snake which is moving rightward will not turn into leftward by pressing key A.
  • There are two kinds of food for the snake: the regular food which displays as a red dot is worth 10 points, and the bonus food, which displays as a pink dot and comes up in a random interval, is worth 20 points
  • Once the snake eats food, no matter which kind, it grows a body segment.
  • The game is over if the snake hits the wall or bites itself.
  • Once the game is over, there will be an interface displaying the final score.
  • At the score display interface, press R to restart the game.
  • Advanced function: players can toggle the moving speed by pressing key F, if the current mode is hard (moving fast), then it will switch to the normal mode (moving smoothly), and vice versa.

Dependencies

  • Penndraw library by UPenn

About

A mini snake game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages