A collection of classic games built with Python! Perfect for learning game development, practicing Python, or just having fun.
| 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 |
- Python 3.7 or higher
- tkinter (usually comes with Python)
- turtle module (comes with Python)
-
Clone the repository:
git clone https://github.com/AnshMNSoni/python-games.git cd python-games -
Install dependencies:
pip install -r requirements.txt
-
Run the game menu:
python main.py
Or run individual games directly:
cd <GameFolder> python main.py
We welcome contributions! See CONTRIBUTING.md for guidelines on:
- Adding new games
- Improving existing games
- Reporting bugs
- Suggesting features
# Install pytest pip install pytest # Run all tests python -m pytest tests/ # Run tests for a specific game python -m pytest tests/BlackJack/
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
This project is licensed under the MIT License - see the LICENSE file for details.
β Star this repo if you find it useful!