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
ghost.h File Reference
Go to the source code of this file.
Data Structures | |
| struct | GHOST |
| This struct contains the status of a ghost. More... | |
Enumerations | |
| enum | GHOST_MOTION { GHOST_UP = 0, GHOST_DOWN, GHOST_LEFT, GHOST_RIGHT } |
The enum defines the motion of a ghost. More... | |
Functions | |
| void | ghost_create (unsigned int blk_x, unsigned int blk_y, unsigned int color) |
| Create a ghost with given position and color. | |
| void | ghost_show (DLinkedList *list) |
| Draw the ghost in the linked list on the screen. | |
| void | ghost_random_walk (void) |
| Move every ghost in the list randomly on the map for one step. | |
| DLinkedList * | get_ghost_list (void) |
| Return the doubly linked list of ghost. | |
| void | super_ghost_create (unsigned int blk_x, unsigned int blk_y, unsigned int color) |
| Extra Feature Function: Create a super ghost with given position and color. | |
| void | super_ghost_random_walk (void) |
| Extra Feature Function: Move the super ghost in the list randomly on the map for one step. | |
| DLinkedList * | get_super_ghost_list (void) |
| Extra Feature Function: Return the doubly linked list of super ghost. | |
Detailed Description
Definition in file ghost.h.
Enumeration Type Documentation
| enum GHOST_MOTION |
Function Documentation
| DLinkedList* get_ghost_list | ( | void | ) |
| DLinkedList* get_super_ghost_list | ( | void | ) |
Extra Feature Function: Return the doubly linked list of super ghost.
| void ghost_create | ( | unsigned int | blk_x, |
| unsigned int | blk_y, | ||
| unsigned int | color | ||
| ) |
| void ghost_random_walk | ( | void | ) |
| void ghost_show | ( | DLinkedList * | list ) |
| void super_ghost_create | ( | unsigned int | blk_x, |
| unsigned int | blk_y, | ||
| unsigned int | color | ||
| ) |
Extra Feature Function: Create a super ghost with given position and color.
Then add to the super ghost doublely linked list A super ghost is itself a max-size-3 linked list. A super ghost is itself a linked list. The head always walk randomly while the other two node keep track of the two lastest history position.
- Parameters:
-
blk_x The horizontal position in the grid. blk_y The vertical position in the grid. color Color of the ghost
| void super_ghost_random_walk | ( | void | ) |
Extra Feature Function: Move the super ghost in the list randomly on the map for one step.
Generated on Thu Aug 4 2022 06:03:35 by
1.7.2
