Skip to content

merlendo/snake-interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Snake Game

This project is a simple implementation of the classic Snake Game using Python and the Pygame library.

Prerequisites

Make sure you have Python and Pygame installed on your machine.

Install Pygame using the following command:

pip install pygame

Versions used when developing:

  • Python 3.10
  • pygame==2.5.2

How to Play

Run the script in your terminal or preferred Python environment using:

python snake_game.py

Use the arrow keys to control the snake (Up, Down, Left, Right). Eat the red apples to grow the snake and increase your score. Avoid collisions with the window borders and the snake's own body. If the game is over, press Enter to restart.

Game Controls

  • ↑ (Up arrow): Change snake direction to up.
  • ↓ (Down arrow): Change snake direction to down.
  • ← (Left arrow): Change snake direction to left.
  • → (Right arrow): Change snake direction to right.

Features

The snake grows longer each time it eats an apple. The game ends if the snake collides with the borders or itself. The score is displayed at the top of the game window.

Customization

You can customize the game by modifying the following parameters in the script:

FPS: Set the frames per second for the game.
WIDTH and HEIGHT: Adjust the dimensions of the game window.
Colors: Modify the color values for WHITE, BLACK, GREY, GREEN, and RED to change the appearance of the game elements.

Feel free to explore and enhance the game according to your preferences!

Enjoy playing the Snake Game! 🐍🍎

About

Graphical snake using pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages