Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE mbed wave_player
Fork of PacMan_Skeleton_unlock by
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
Generated on Thu Aug 4 2022 06:03:35 by
1.7.2
