Ransom Conant / Mbed 2 deprecated MbedPacman

Dependencies:   4DGL-uLCD-SE mbed wave_player

Fork of PacMan_Skeleton_unlock by ECE 2035 TA

Embed: (wiki syntax)

« Back to documentation index

main.cpp File Reference

main.cpp File Reference

Go to the source code of this file.

Functions

int main ()
 Main() is where you start your implementation.

Detailed Description

Definition in file main.cpp.


Function Documentation

int main (  )

Main() is where you start your implementation.

The hints of implementation are in the comments.
You are expected to implement your code in main.cpp and pacman.cpp. But you could modify any code if you want to make the game work better.

[Example of time control implementation]

Here is a rough example to implement the timer control

[Example of the game control implementation] Here is the example to initialize the game

1. Begin the game loop

2. Implement the code to get user input and update the Pacman -[Hint] Implement the code to move Pacman. You could use either push-button or accelerometer.
The accelerometer's function readXYZGravity() might be useful.

3. Update the Pacman on the screen -[Hint] You could update the position of Pacman here based on the input at step 2.

4. Implement the code to check the end of game. -[Hint] Check whether the ghost catch the Pacman. Make sure you could always detect that the ghost and Pacman meet on the screen. One tricky scenario is that: Pacman is at grid (3,3) and is heading to (3,4), while the ghost is at grid (3,4) and is heading to (3,3). Either at time t or t+1, you will see that the Pacman and the ghost are not on the same grid. However, the Pacman should be caught by ghost with this movement.

-[Hint] Check whether Pacman win the game

Definition at line 57 of file main.cpp.