Game for Project 2

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed wave_player

Committer:
leuyentran
Date:
Thu Jun 25 14:35:52 2015 +0000
Revision:
0:7fe3c940e4b5
Georgia Tech ECE2035 Sum 15

Who changed what in which revision?

UserRevisionLine numberNew contents of line
leuyentran 0:7fe3c940e4b5 1 /* Gatech ECE2035 2015 SPRING PAC MAN
leuyentran 0:7fe3c940e4b5 2 * Copyright (c) 2015 Gatech ECE2035
leuyentran 0:7fe3c940e4b5 3 *
leuyentran 0:7fe3c940e4b5 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
leuyentran 0:7fe3c940e4b5 5 * of this software and associated documentation files (the "Software"), to deal
leuyentran 0:7fe3c940e4b5 6 * in the Software without restriction, including without limitation the rights
leuyentran 0:7fe3c940e4b5 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
leuyentran 0:7fe3c940e4b5 8 * copies of the Software, and to permit persons to whom the Software is
leuyentran 0:7fe3c940e4b5 9 * furnished to do so, subject to the following conditions:
leuyentran 0:7fe3c940e4b5 10 *
leuyentran 0:7fe3c940e4b5 11 * The above copyright notice and this permission notice shall be included in
leuyentran 0:7fe3c940e4b5 12 * all copies or substantial portions of the Software.
leuyentran 0:7fe3c940e4b5 13 *
leuyentran 0:7fe3c940e4b5 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
leuyentran 0:7fe3c940e4b5 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
leuyentran 0:7fe3c940e4b5 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
leuyentran 0:7fe3c940e4b5 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
leuyentran 0:7fe3c940e4b5 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
leuyentran 0:7fe3c940e4b5 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
leuyentran 0:7fe3c940e4b5 20 * SOFTWARE.
leuyentran 0:7fe3c940e4b5 21 */
leuyentran 0:7fe3c940e4b5 22 /** @file map_public.h */
leuyentran 0:7fe3c940e4b5 23 #ifndef MAP_PUBLIC_H
leuyentran 0:7fe3c940e4b5 24 #define MAP_PUBLIC_H
leuyentran 0:7fe3c940e4b5 25
leuyentran 0:7fe3c940e4b5 26 /// The enum define the status of a grid on the map
leuyentran 0:7fe3c940e4b5 27 typedef enum {
leuyentran 0:7fe3c940e4b5 28 GRID_SIDE_WALK=0, //Side_walk
leuyentran 0:7fe3c940e4b5 29 GRID_CANDY, ///< A candy
leuyentran 0:7fe3c940e4b5 30 GRID_BIG_CANDY, // Bigger candy!
leuyentran 0:7fe3c940e4b5 31 GRID_ROAD_L, //Road left
leuyentran 0:7fe3c940e4b5 32 GRID_ROAD,
leuyentran 0:7fe3c940e4b5 33 GRID_ROAD_R,
leuyentran 0:7fe3c940e4b5 34 GRID_V_LINE, //V_line
leuyentran 0:7fe3c940e4b5 35 GRID_SIDE_WALK_2,
leuyentran 0:7fe3c940e4b5 36 } GRID_STATUS;
leuyentran 0:7fe3c940e4b5 37
leuyentran 0:7fe3c940e4b5 38 /// The structure to store the information of a grid
leuyentran 0:7fe3c940e4b5 39 typedef struct {
leuyentran 0:7fe3c940e4b5 40 int x; ///< The upper-left corner of the grid. It is the x coordinate on the screen.
leuyentran 0:7fe3c940e4b5 41 int y; ///< The upper-left corner of the grid. It is the y coordinate on the screen.
leuyentran 0:7fe3c940e4b5 42 GRID_STATUS status; ///< See enum GRID_STATUS
leuyentran 0:7fe3c940e4b5 43 } GRID;
leuyentran 0:7fe3c940e4b5 44
leuyentran 0:7fe3c940e4b5 45 /** Call map_init() once at the begining of your code
leuyentran 0:7fe3c940e4b5 46 @brief It initialize the map structure and draw the map.
leuyentran 0:7fe3c940e4b5 47 */
leuyentran 0:7fe3c940e4b5 48 void map_init(void);
leuyentran 0:7fe3c940e4b5 49
leuyentran 0:7fe3c940e4b5 50 /** Remove the cookie/super-cookie from map
leuyentran 0:7fe3c940e4b5 51 @brief It could be called by Pacman when it eat the cookie.
leuyentran 0:7fe3c940e4b5 52 @param grid_x The horizontal position in the grid.
leuyentran 0:7fe3c940e4b5 53 @param grid_y The vertical position in the grid.
leuyentran 0:7fe3c940e4b5 54 @return 1:There is a cookie be eaten. 0:The is no cookie at the grid.
leuyentran 0:7fe3c940e4b5 55 */
leuyentran 0:7fe3c940e4b5 56 bool map_eat_candy(int grid_x, int grid_y);
leuyentran 0:7fe3c940e4b5 57
leuyentran 0:7fe3c940e4b5 58 /** Get the information about the grid
leuyentran 0:7fe3c940e4b5 59 @param grid_x The horizontal position in the grid.
leuyentran 0:7fe3c940e4b5 60 @param grid_y The vertical position in the grid.
leuyentran 0:7fe3c940e4b5 61 @return The data structure of the grid. You could access the contents by using the_grid.x , the_grid.status ... etc.
leuyentran 0:7fe3c940e4b5 62 */
leuyentran 0:7fe3c940e4b5 63 GRID map_get_grid_status(int grid_x, int grid_y);
leuyentran 0:7fe3c940e4b5 64
leuyentran 0:7fe3c940e4b5 65 /** Draw the grid
leuyentran 0:7fe3c940e4b5 66 @param grid_x The horizontal position in the grid.
leuyentran 0:7fe3c940e4b5 67 @param grid_y The vertical position in the grid.
leuyentran 0:7fe3c940e4b5 68 */
leuyentran 0:7fe3c940e4b5 69 void map_draw_grid(unsigned grid_x, unsigned grid_y);
leuyentran 0:7fe3c940e4b5 70
leuyentran 0:7fe3c940e4b5 71 /** Get the number of remaining cookie.
leuyentran 0:7fe3c940e4b5 72 @brief The game should be ended when there is no cookie.
leuyentran 0:7fe3c940e4b5 73 @return The number of remaining cookie.
leuyentran 0:7fe3c940e4b5 74 */
leuyentran 0:7fe3c940e4b5 75 int map_remaining_candy(void);
leuyentran 0:7fe3c940e4b5 76
leuyentran 0:7fe3c940e4b5 77 #endif //MAP_H