Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A collection of classic games built with Python! Perfect for learning game development, practicing Python, or just having fun.

License

Notifications You must be signed in to change notification settings

AnshMNSoni/python-games

Repository files navigation

Python Games Collection

A collection of classic games built with Python! Perfect for learning game development, practicing Python, or just having fun.

Available Games

Game Description Run Command
BlackJack Classic casino card game with betting cd BlackJack && python main.py
SnakeGame Control the snake, eat food, grow longer! cd SnakeGame && python main.py
PingPong Two-player ping pong with sound effects cd PingPong && python main.py
Breakout Break all the bricks with your paddle cd Breakout && python main.py
Pacman Navigate the maze, avoid ghosts cd Pacman && python main.py
Hangman Word guessing game cd Hangman && python main.py
TurtleCrossing Help the turtle cross the road cd TurtleCrossing && python main.py
KBC Quiz game inspired by Kaun Banega Crorepati cd KBC && python main.py
RockPaperScissor Classic hand game vs computer cd RockPaperScissor && python main.py

Getting Started

Prerequisites

  • Python 3.7 or higher
  • tkinter (usually comes with Python)
  • turtle module (comes with Python)

Installation

  1. Clone the repository:

    git clone https://github.com/AnshMNSoni/python-games.git
    cd python-games
  2. Install dependencies:

    pip install -r requirements.txt
  3. Run the game menu:

    python main.py

    Or run individual games directly:

    cd <GameFolder>
    python main.py

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines on:

  • Adding new games
  • Improving existing games
  • Reporting bugs
  • Suggesting features

Running Tests

# Install pytest
pip install pytest
# Run all tests
python -m pytest tests/
# Run tests for a specific game
python -m pytest tests/BlackJack/

πŸ“ Project Structure

python-games/
β”œβ”€β”€ BlackJack/ # Card game with GUI
β”œβ”€β”€ SnakeGame/ # Classic snake game
β”œβ”€β”€ PingPong/ # Pong with sound
β”œβ”€β”€ Breakout/ # Brick breaker
β”œβ”€β”€ Pacman/ # Maze game
β”œβ”€β”€ Hangman/ # Word guessing
β”œβ”€β”€ TurtleCrossing/ # Road crossing game
β”œβ”€β”€ KBC/ # Quiz game
β”œβ”€β”€ RockPaperScissor/ # Hand game
β”œβ”€β”€ tests/ # Unit tests for all games
β”œβ”€β”€ main.py # main executor file
β”œβ”€β”€ banner.py # python-games logo
β”œβ”€β”€ CONTRIBUTING.md # Contribution guidelines
└── README.md # This file

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


⭐ Star this repo if you find it useful!

About

A collection of classic games built with Python! Perfect for learning game development, practicing Python, or just having fun.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /