Game for Project 2

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed wave_player

Embed: (wiki syntax)

« Back to documentation index

map_public.h File Reference

map_public.h File Reference

Go to the source code of this file.

Data Structures

struct  GRID
 The structure to store the information of a grid. More...

Enumerations

enum  GRID_STATUS { , GRID_CANDY }
 

The enum define the status of a grid on the map.

More...

Functions

void map_init (void)
 Call map_init() once at the begining of your code.
bool map_eat_candy (int grid_x, int grid_y)
 Remove the cookie/super-cookie from map.
GRID map_get_grid_status (int grid_x, int grid_y)
 Get the information about the grid.
void map_draw_grid (unsigned grid_x, unsigned grid_y)
 Draw the grid.
int map_remaining_candy (void)
 Get the number of remaining cookie.

Detailed Description

Definition in file map_public.h.


Enumeration Type Documentation

The enum define the status of a grid on the map.

Enumerator:
GRID_CANDY 

A candy.

Definition at line 27 of file map_public.h.


Function Documentation

void map_draw_grid ( unsigned  grid_x,
unsigned  grid_y 
)

Draw the grid.

Parameters:
grid_xThe horizontal position in the grid.
grid_yThe vertical position in the grid.

Definition at line 76 of file map.cpp.

bool map_eat_candy ( int  grid_x,
int  grid_y 
)

Remove the cookie/super-cookie from map.

It could be called by Pacman when it eat the cookie.

Parameters:
grid_xThe horizontal position in the grid.
grid_yThe vertical position in the grid.
Returns:
1:There is a cookie be eaten. 0:The is no cookie at the grid.

Definition at line 108 of file map.cpp.

GRID map_get_grid_status ( int  grid_x,
int  grid_y 
)

Get the information about the grid.

Parameters:
grid_xThe horizontal position in the grid.
grid_yThe vertical position in the grid.
Returns:
The data structure of the grid. You could access the contents by using the_grid.x , the_grid.status ... etc.

Definition at line 104 of file map.cpp.

void map_init ( void   )

Call map_init() once at the begining of your code.

It initialize the map structure and draw the map.

Definition at line 28 of file map.cpp.

int map_remaining_candy ( void   )

Get the number of remaining cookie.

The game should be ended when there is no cookie.

Returns:
The number of remaining cookie.

Definition at line 119 of file map.cpp.