Skip to content

PacMan game for a LPC1768 board. This was an optional project for the course Computer Architectures at Politecnico di Torino in 2024/2025.

License

Notifications You must be signed in to change notification settings

MirkoDinapoli/LPC1768-PacMan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PacMan for LPC768 board

This project aims at developing a simplified version of Pac Man for an LPC1768 board
The implementation uses:

  • Joystick for PacMan movement
  • speaker for sound effects and background music
  • CAN bus communication to share game info as score, time and remaining lives

PacMan on simulator, with missing info (time, score and lives), as they are passed through CAN.

Features

Map and pills

  • maze has 240 Standard pills and 6 Power pills at random positions each time a game is started;
  • central box, which is Blinky's home
  • PacMan moves continuously in the last chosen direction until he hits a wall or recives a new input
  • PacMan can teletrasport himself when he he enters in a teletrasportation point

Score and lives

  • Standard pills: +10 points
  • Power pills: +50 points
  • extra life (up to 3 total lives) every 1000 points

Game

  • lasts 60 seconds
  • at the beginning Pacman has 3 lives
  • lost when PacMan loses all his lives or timer reaches 0
  • won when every pill has been eaten by PacMan

Blinky

Blinky, the main antagonist of the game, directly follows Pac-Man, always trying to reach him and eat him. However, his behavior changes based on the game mode:

  1. Chase Mode: Blinky actively tries to catch Pac-Man.
  2. Frightened Mode: activates when PacMan eats a "Power pill". Blinky turns blue for 10 seconds, runs away from PacMan, and can be eaten by him for extra 100 points. If the ghost is eaten, it will respawn after 3 seconds in the central box.

The algorithm used to calculate the best path to reach or distance PacMan is a greedy one: Manhattan distance. So at every PacMan move Blinky, knowing his and PacMan positions in the map, moves in the direction which minimizes (Chase mode) / maximizes (Frightened mode) the distance from PacMan.

How to play

Running the code

  1. compile the code in Keil µVision.
  2. connect wires to use the CAN bus in loopback mode: CAN1 is the sender and CAN2 is the receiver;
  3. flash the program onto the LandTiger board.

Controls

  • INT0: press it to start or pause the game
  • JOYSTICK: use it to move PacMan in the desired direction

About

PacMan game for a LPC1768 board. This was an optional project for the course Computer Architectures at Politecnico di Torino in 2024/2025.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published