Skip to content

Harisshafi01/python-snake-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

python-snake-game

this is a snake game using python

Snake Game

This is a simple implementation of the classic Snake game using Python and the tkinter library. The game allows the player to control a snake and eat food to grow longer. The goal is to avoid collisions with the walls or the snake's own body.

Prerequisites

  • Python 3.x
  • tkinter library (usually included with Python)

How to Play

  1. Run the script using the following command:

  2. The game window will open, displaying the snake and food.

  3. Use the arrow keys to control the snake's direction: up, down, left, and right.

  4. The snake will move continuously in the specified direction.

  5. Guide the snake to eat the food, which will cause it to grow longer.

  6. The game ends if the snake collides with the walls or its own body.

  7. The score will be displayed at the top of the game window, indicating the number of food items eaten.

Customization

  • You can modify various aspects of the game by adjusting the global constants defined at the beginning of the script. For example, you can change the game's dimensions, speed, colors, and more.
  • Feel free to experiment and customize the game to your liking.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

this is a snake game using python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages