Skip to content

EnzoJantjies216097975/PacMan-Python-Game

Repository files navigation

Pac-Man Python Game

readme.png

Table of Contents

  • About the Project
  • Features
  • Installation
  • Usage
  • Game Mechanics
  • How to Play
  • Project Structure
  • Technologies Used
  • Contributing
  • License
  • Contact

About the Project

The Pac-Man Python Game is a modern rendition of the classic arcade game, developed using Python and Pygame. This project aims to replicate the gameplay of the original Namco Pac-Man game, including unique ghost behaviors, animations, and challenging maze navigation.

Features

  • Fully functional game mechanics with player control and ghost AI.
  • Animation and Sound Effects: Authentic sound effects and animations for an immersive experience.
  • Maze Design: Uses 8x8 px tiles to create the maze, allowing for customizable layouts.
  • Collision Detection for walls and ghost interactions.
  • Score Tracking and levels.

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/pacman-python-game.git
 
cd pacman-python-game
  1. Install dependencies: Ensure you have Python installed. Install pygame via:
pip install pygame
  1. Run the game:
python main.py

Usage

  • Run main.py to start the game.
  • Control Pac-Man using the arrow keys on your keyboard.
  • Collect all the pellets and avoid the ghosts to progress through levels.

Game Mechanics

  • Player Movement: Move Pac-Man through the maze using the arrow keys.
  • Ghost AI: Ghosts move strategically and have different behaviors.
  • Power-Ups: Eat power pellets to temporarily turn the tables and chase the ghosts.
  • Teleportation: Use pathways to move from one side of the maze to the other.
  • Game Over: The game ends when Pac-Man loses all lives.

How to Play

  • Objective: Collect all the dots in the maze while avoiding the ghosts.
  • Controls:
    • Arrow Keys: Navigate Pac-Man through the maze.
  • Scoring:
    • Pellets: +10 points each.
    • Power Pellets: +50 points and enables ghost chasing for a short period.
    • Ghosts (when powered up): +200 points each (increases with consecutive captures).

Project Structure

PacMan-Python-Game/\
│
├── assets/              # Game assets such as images and sound
├── ghosts/ 
│   ├── pacman/ 
│   └── tiles/ 
│ 
├── main.py              # Main game loop 
├── ghost.py             # Ghost class and logic 
├── pacman.py            # Pac-Man player logic 
├── settings.py          # Game settings and constants
└── world.py             # World/maze generation and wall collision logic

Technologies Used

  • Python 3.12.7
  • Pygame 1.9.1 (for game development)

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the project.
  2. Create a feature branch (git checkout -b feature/new-feature).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature/new-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License.

Contact

Enzo Jantjies

About

Pacman game in Python (Practice)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages