Skip to content

PravithChary/pygame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Snake Eater

A snake game written in Python using the Pygame library.

Installing

Download the Python 3 installer package from the official website and install it, if not installed previously.

Run the following in the terminal to install the Pygame library

pip3 install pygame

Running the application

Download the source code from the repository and run the file just as any other Python script (.py) file.

python3 Snake\ Game.py

The difficulty variable can be changed with the values provided in the comment to set the difficulty level.

The rest of the code is properly commented and self explanatory. Tweaks can be made to change the play style or visuals of the game.

Prerequisites

  • Python
  • Pygame, an open source Python library for making multimedia applications

Rules to play the game

  • As soon as the game starts, the score will be initialised to zero, which can be viewed at the top left of the game.
  • A snake and a ball will be visible
  • The directions to move in the game are as follows
    • Right -> right arrow or D
    • Left -> left arrow or A
    • Down -> down arrow or S
    • Up -> upwards arrow or W
  • As the snake eats the ball, its size and score get increased.
  • Touching to the walls leads to the death of the snake and hence the games haults displaying the score.

Demo Video of Playing

Click Here

Screenshots

Here are few screenshots or initial, intermediate and the terminated stages.

  • Game Starts

initial

  • Game in progress

intermediate

  • Game Over

dead

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages