Skip to main content

A Pygame Pacman clone with multiple ghost behaviors and difficulty levels.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pacman_chasing_game-0.1.0.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pacman_chasing_game-0.1.0-py3-none-any.whl (44.6 kB view details)

Uploaded Python 3

File details

Details for the file pacman_chasing_game-0.1.0.tar.gz.

File metadata

  • Download URL: pacman_chasing_game-0.1.0.tar.gz
  • Upload date:
  • Size: 44.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for pacman_chasing_game-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3766b207a0a3670a17ae86f5e0d32c7467bfe528c505135df82dd3a1b8a6de0c
MD5 653f14636cb5e4f02e511a955cffe09c
BLAKE2b-256 5238646fb099f443d5f685d8773042ab6fd897d84a10a13efd2d8a3474102977

See more details on using hashes here.

File details

Details for the file pacman_chasing_game-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pacman_chasing_game-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 089713318fb5e52cb82fd188f44c3dfff5575af93e25c92093d7bae17f1407c3
MD5 0b330a7b4dac5b0cbe4add8cb15093f3
BLAKE2b-256 7bfb52a5932f668689858b434e47932c33e27e373e5592abb893523e3550fd94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page