Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game (Python)

A classic Snake Game developed using Python and the Turtle graphics library.

Features

  • Continuous snake movement
  • Keyboard controls
  • Random food spawning
  • Score tracking
  • Snake growth after eating food
  • Wall collision detection
  • Self-collision detection
  • Game Over screen

Technologies Used

  • Python
  • Turtle Graphics
  • Object-Oriented Programming (OOP)

Project Structure

main.py - Main game loop and collision detection

snake.py - Snake class and movement logic

food.py - Food generation and random spawning

scoreboard.py - Score tracking and game over display

How to Run

  1. Clone the repository

git clone

  1. Navigate into project folder

cd python-snake-game

  1. Run

python main.py

Screenshots

Gameplay

image

Game Over

image

Learning Outcomes

This project helped me practice:

  • Object-Oriented Programming
  • Class Design
  • Event Handling
  • Collision Detection
  • Game Loops
  • Python Turtle Graphics

Future Improvements

Potential features that could be added in future versions of the game:

  • High Score System

    • Save and display the highest score achieved across game sessions.
  • Difficulty Levels

    • Allow players to choose Easy, Medium, or Hard modes with different snake speeds.
  • Pause and Resume Functionality

    • Enable players to pause and continue the game using a keyboard shortcut.
  • Sound Effects

    • Add audio feedback for eating food and game-over events.
  • Improved Graphics

    • Replace default Turtle shapes with custom sprites and backgrounds.
  • Obstacles

    • Introduce walls or obstacles that the snake must avoid.
  • Restart Option

    • Allow players to restart the game without closing the application.
  • Power-Ups

    • Add special food items that provide bonus points or temporary abilities.
  • Multiplayer Mode

    • Support two-player gameplay using different keyboard controls.
  • Scoreboard Enhancements

    • Display current score, high score, and game statistics.

Author

Netri Patel Bachelor of Information Technology Major in Networks & Cyber Security Griffith University

About

Classic Snake Game built with Python and Turtle Graphics using Object-Oriented Programming principles.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages