Skip to main content

Pacman

This is an advanced version of the famous Pacman game.

This is also a process of me learning Pygame.

Here I'm going to introduce how the game's played and a bit of its inner workings

Structure

  • A maze map and its food based on a text file
  • A 16 x 16 grid map
  • A 592 x 592 map
  • Player (Pacman)
  • Ghosts (Red and Purple)

Text file to map

  • | means an apple (later description)
  • A star means a wall

It allows users to make their own map.

Sprites

Pacman (user-controlled)

Red Ghost (follows and chases Pacman)

Purple Ghost (teleports to Pacman)

Levels

  • Level 1: one ghost (red only)
  • Level 2: two ghost (red and purple)
  • Level 3: two ghost but faster

Controls

W, A, S, D --> up, left, down, right

Win and Lose

  • Win: Get a total of 250 points

  • Lose: Be touched by a ghost

How to get points?

By eating food

  • apple: 2 points
  • pellets: 1 point

What to install to run the game

  • Python 3.10+

  • Pygame

pip install -r requirements.txt

To run the game

python pacman_chasing.py

File description

  • pacman_chasing.py: the game's main file
  • map2.txt: the map
  • pacman.png, wall.png, red_ball.jpg, food.png, ghost.png, ghost(2).jpg: The Pacman, the wall grid, the apple, the pellet, the red ghost, the purple ghost respectively

My progress

This is a project I made while learning Pygame. Hope this game is enjoyable to others to play. I'm proud of the progress I made in my journey in game design.

AI Implementation

Disclaimer: This project is 100% made by me, completely on my own. However, I did ask AI for advice for specific numbers, such as color scale (styling), sizes of the start and end menus, fonts etc.. Generated the .gitgore file, if that counts.

Future possible improvements

  • Add a feature that connects an AI to generate a new map everytime
  • Add special effects when eating or when ghost teleports
  • Make better UI and graphics with Godot.
  • Save high scores for individual users.
  • Add lives so that players won't instantly die.

Conclusion

This is a really fun game I made, I had a lot of fun making it and hopefully everyone can enjoy it too. This project has broaden my horizons on game design with Pygame and explored possibilities of further improvements.

Metadata

Release files for pacman-chasing-game 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pacman-chasing-game 0.1.0
File Size Uploaded
pacman_chasing_game-0.1.0.tar.gz 44.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pacman-chasing-game 0.1.0
File Interpreter ABI Platform
pacman_chasing_game-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 88.7 kB

Release files / pacman_chasing_game-0.1.0.tar.gz

Download URL pacman_chasing_game-0.1.0.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3766b207a0a3670a17ae86f5e0d32c7467bfe528c505135df82dd3a1b8a6de0c
BLAKE2b-256 checksum
How to use checksums
5238646fb099f443d5f685d8773042ab6fd897d84a10a13efd2d8a3474102977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release files / pacman_chasing_game-0.1.0-py3-none-any.whl

Download URL pacman_chasing_game-0.1.0-py3-none-any.whl
Size 44.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
089713318fb5e52cb82fd188f44c3dfff5575af93e25c92093d7bae17f1407c3
BLAKE2b-256 checksum
How to use checksums
7bfb52a5932f668689858b434e47932c33e27e373e5592abb893523e3550fd94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page