Game for Project 2

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed wave_player

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers map_private.h Source File

map_private.h

00001 /* Gatech ECE2035 2015 SPRING PAC MAN
00002  * Copyright (c) 2015 Gatech ECE2035
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a copy
00005  * of this software and associated documentation files (the "Software"), to deal
00006  * in the Software without restriction, including without limitation the rights
00007  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00008  * copies of the Software, and to permit persons to whom the Software is
00009  * furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included in
00012  * all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00019  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00020  * SOFTWARE.
00021  */
00022 #ifndef MAP_PRIVATE_H
00023 #define MAP_PRIVATE_H
00024 
00025 #include "mbed.h"
00026 
00027 #ifndef ULCD_4DGL_H_
00028 #define ULCD_4DGL_H_
00029 #include "uLCD_4DGL.h"
00030 #endif
00031 
00032 #include "globals.h"
00033 #include "map_public.h "
00034 
00035 // It defines the settings for drawing the map
00036 #define SIDE_WALK_COLOR_2    0x999999
00037 #define SIDE_WALK_COLOR    0x198C19
00038 #define LINE_COLOR  0xE5E500
00039 #define CANDY_COLOR  0xFF7F7F
00040 #define CANDY_RADIUS 1
00041 #define BIG_CANDY_RADIUS 2
00042 #define WHITE 0xFFFFFF
00043 
00044 
00045 
00046 // It defines the values used in the DEFAULT_MAP
00047 #define MAP_ATTRIBUTE_SIDE_WALK         0 //side walk
00048 #define MAP_ATTRIBUTE_CANDY       1 //candy
00049 #define MAP_ATTRIBUTE_BIG_CANDY 2 //big candy
00050 #define MAP_ATTRIBUTE_ROAD_L 3
00051 #define MAP_ATTRIBUTE_ROAD 4
00052 #define MAP_ATTRIBUTE_ROAD_R 5
00053 #define MAP_ATTRIBUTE_V_LINE 6
00054 #define MAP_ATTRIBUTE_SIDE_WALK_2 7
00055 
00056 
00057 #define DEFAULT_MAP {\
00058 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00059 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00060 0,   0,   0,   7,   3,   1,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00061 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00062 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00063 0,   0,   0,   7,   3,   2,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00064 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00065 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00066 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00067 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00068 0,   0,   0,   7,   3,   1,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00069 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00070 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00071 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00072 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6,  \
00073 0,   0,   0,   7,   3,   4,   5,   3,   4,   5,   3,   4,   5,   7,   6,   6,   6, }
00074 
00075 // Here defines some useful macros
00076 #define IDX2X(idx)  (idx%NUM_GRID_X)
00077 #define IDX2Y(idx)  (idx/NUM_GRID_X)
00078 #define XY2IDX(x,y) (y*NUM_GRID_X+x)
00079 
00080 void map_draw(void);
00081 
00082 
00083 #endif //MAP_H