Skip to content

Latest commit

History

99 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Pac-Man in Python 😶🎮

This is a beginner-friendly Pac-Man clone built using Python's Turtle Graphics module.

The code is part of a full YouTube tutorial series, where we build the game step by step — covering everything from drawing the maze to player movement, collision logic, and more.

🎥 Watch the Tutorial Series

YouTube Playlist: Pac-Man in Python - Full Tutorial Series


📚 Table of Contents

Use the links below to access the code for each episode:

  1. Episode 1 – Project & Screen Setup
  2. Episodes 2 & 3 – Grid & Maze Drawing
  3. Episode 4 – Player Setup
  4. Episode 5 – Wall Collision
  5. Episode 6 – UI & Pellet Collection
  6. Episode 7 – Enemies Setup
  7. Episode 8 – Enemy AI & Final Polish
  8. Episode 9 – Final Game: Shapes & Sounds

📂 View Full Project Structure


Follow along to:

  • Learn basic game development concepts.
  • Use Python's Turtle module for graphics.
  • Practice clean, modular code structure.
  • Build a playable Pac-Man game from scratch.

📁 Project Structure

pacman-turtle-python/
│
├── README.md
├── LICENSE
├── .gitignore
├── media/
│ └── final_game.mp4
│
└── episodes/
├── episode01/ # Project & Screen setup
| ├── README.md
│ └── main.py
│
├── episode02_03/ # Grid & Maze Drawing
| ├── README.md
│ ├── constants.py
│ ├── main.py
│ ├── mazes.py
│ └── renderer.py
│
├── episode04/ # Player setup
| ├── README.md
│ ├── actors.py
│ ├── constants.py
│ ├── main.py
│ ├── mazes.py
│ └── renderer.py
│
├── episode05/ # Wall Collision
| ├── README.md
│ ├── actors.py
│ ├── constants.py
│ ├── main.py
│ ├── mazes.py
│ └── renderer.py
│
├── episode06/ # UI & Pellet Collection
| ├── README.md
│ ├── actors.py
│ ├── constants.py
│ ├── main.py
│ ├── mazes.py
│ └── renderer.py
│
├── episode07/ # Enemies Setup
| ├── README.md
│ ├── actors.py
│ ├── constants.py
│ ├── main.py
│ ├── mazes.py
│ └── renderer.py
│
├── episode08/ # Enemy AI & Final Polish
| ├── README.md
│ ├── actors.py
│ ├── constants.py
│ ├── main.py
│ ├── mazes.py
│ └── renderer.py
│
└── episode09/ # Final Game: Shapes & Sounds
├── README.md
├── actors.py
├── constants.py
├── death.wav
├── down.gif
├── eat.wav
├── green_enemy.gif
├── left.gif
├── main.py
├── mazes.py
├── pac.gif
├── pink_enemy.gif
├── red_enemy.gif
├── renderer.py
├── right.gif
├── start_up.wav
├── up.gif
└── wall.gif

📦 Note:

  • episode08/ contains the final version of the game logic, before graphics and sound were added.
  • episode09/ contains the final version of the game, including all custom graphics and sound effects.
  • 🔊 Sound command depends on your OS — see the README.md in episode09/ for more details.
  • Movement speed may feel different across operating systems and computers. You can tweak the parameters inside constants.py to adjust the speed for a smoother experience.

📋 Requirements

No external libraries needed – just Python 3.x.

Make sure turtle is available (it's included with standard Python installs).

▶️ How to Run

python main.py

The game window will open, and you can start playing Pac-Man using the arrow keys!

📌 About the Creator

Created by TheWannabeCoder
Making simple, hands-on Python tutorials for beginners.
YouTube: @TheWannabeCoder

📜 License

This project is licensed under the MIT License.

Releases

Packages

Used by

Contributors

Languages