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

- 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
- Standard pills: +10 points
- Power pills: +50 points
- extra life (up to 3 total lives) every 1000 points
- 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, 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:
- Chase Mode: Blinky actively tries to catch Pac-Man.
- 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.
- compile the code in Keil µVision.
- connect wires to use the CAN bus in loopback mode: CAN1 is the sender and CAN2 is the receiver;
- flash the program onto the LandTiger board.
- INT0: press it to start or pause the game
- JOYSTICK: use it to move PacMan in the desired direction