4180 lab4

Dependencies:   4DGL-uLCD-SE DebounceIn SDFileSystem mbed-rtos mbed wave_player

Fork of WavePlayer_HelloWorld by jim hamblen

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers map_private.h Source File

map_private.h

00001 #ifndef MAP_PRIVATE_H
00002 #define MAP_PRIVATE_H
00003 
00004 #include "mbed.h"
00005 
00006 #ifndef ULCD_4DGL_H_
00007 #define ULCD_4DGL_H_
00008 #include "uLCD_4DGL.h"
00009 #endif
00010 
00011 #include "globals.h"
00012 #include "map_public.h"
00013 
00014 // It defines the settings for drawing the map
00015 #define BACK_COLOR 0x000000
00016 #define SIDELINE_COLOR 0xFF7F7F
00017 #define NODELINE_COLOR 0xE5E500
00018 //#define SIDE_WALK_COLOR_2    0x999999
00019 //#define SIDE_WALK_COLOR    0x198C19
00020 //#define LINE_COLOR  0xE5E500
00021 //#define CANDY_COLOR  0xFF7F7F
00022 //#define CANDY_RADIUS 1
00023 //#define BIG_CANDY_RADIUS 2
00024 //#define WHITE 0xFFFFFF
00025 
00026 
00027 
00028 // It defines the values used in the DEFAULT_MAP
00029 #define MAP_ATTRIBUTE_BACK 0
00030 #define MAP_ATTRIBUTE_SIDELINE 1
00031 //#define MAP_ATTRIBUTE_SCORE 2
00032 #define MAP_ATTRIBUTE_NODELINE 2
00033 /*
00034 #define MAP_ATTRIBUTE_SIDE_WALK   0 //side walk
00035 #define MAP_ATTRIBUTE_CANDY       1 //candy
00036 #define MAP_ATTRIBUTE_BIG_CANDY   2 //big candy
00037 #define MAP_ATTRIBUTE_ROAD_L      3 //left side of the road    
00038 #define MAP_ATTRIBUTE_ROAD        4 //middle of the road
00039 #define MAP_ATTRIBUTE_ROAD_R      5 //right side of the road
00040 #define MAP_ATTRIBUTE_V_LINE      6 //finish line
00041 #define MAP_ATTRIBUTE_SIDE_WALK_2 7 
00042 */
00043 
00044 #define DEFAULT_MAP {\
00045 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00046 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00047 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00048 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00049 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00050 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00051 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00052 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00053 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00054 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00055 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00056 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00057 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00058 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00059 0,   0,   0,   0,   1,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,  \
00060 0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,  \
00061 }
00062 
00063 // Here defines some useful macros
00064 #define IDX2X(idx)  (idx%NUM_GRID_X)
00065 #define IDX2Y(idx)  (idx/NUM_GRID_X)
00066 #define XY2IDX(x,y) (y*NUM_GRID_X+x)
00067 
00068 void map_draw(void);
00069 
00070 
00071 #endif //MAP_H