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

ghost.h File Reference

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.
DLinkedListget_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.
DLinkedListget_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

The enum defines the motion of a ghost.

Enumerator:
GHOST_UP 

move up

GHOST_DOWN 

move down

GHOST_LEFT 

move left

GHOST_RIGHT 

move right

Definition at line 38 of file ghost.h.


Function Documentation

DLinkedList* get_ghost_list ( void   )

Return the doubly linked list of ghost.

Definition at line 164 of file ghost.cpp.

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 
)

Create a ghost with given position and color.

Then add to the ghost doublely linked list

Parameters:
blk_xThe horizontal position in the grid.
blk_yThe vertical position in the grid.
colorColor of the ghost

Definition at line 155 of file ghost.cpp.

void ghost_random_walk ( void   )

Move every ghost in the list randomly on the map for one step.

Definition at line 198 of file ghost.cpp.

void ghost_show ( DLinkedList list )

Draw the ghost in the linked list on the screen.

Definition at line 169 of file ghost.cpp.

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_xThe horizontal position in the grid.
blk_yThe vertical position in the grid.
colorColor 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.