frogger game revision
Dependencies: 4DGL-uLCD-SE MMA8452 SDFileSystem mbed wave_player
Fork of ECE2035_FroggerGame_SUM2015 by
map/map_private.h@9:47f07aa85f1a, 2016-02-01 (annotated)
- Committer:
- ssong86
- Date:
- Mon Feb 01 06:43:06 2016 +0000
- Revision:
- 9:47f07aa85f1a
- Parent:
- 6:5ed435a31cc7
frogger
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ece2035ta | 6:5ed435a31cc7 | 1 | /*Gatech ECE2035 2015 SUMMER ROBOFROGGER |
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 | #ifndef MAP_PRIVATE_H |
leuyentran | 0:7fe3c940e4b5 | 23 | #define MAP_PRIVATE_H |
leuyentran | 0:7fe3c940e4b5 | 24 | |
leuyentran | 0:7fe3c940e4b5 | 25 | #include "mbed.h" |
leuyentran | 0:7fe3c940e4b5 | 26 | |
leuyentran | 0:7fe3c940e4b5 | 27 | #ifndef ULCD_4DGL_H_ |
leuyentran | 0:7fe3c940e4b5 | 28 | #define ULCD_4DGL_H_ |
leuyentran | 0:7fe3c940e4b5 | 29 | #include "uLCD_4DGL.h" |
leuyentran | 0:7fe3c940e4b5 | 30 | #endif |
leuyentran | 0:7fe3c940e4b5 | 31 | |
leuyentran | 0:7fe3c940e4b5 | 32 | #include "globals.h" |
leuyentran | 0:7fe3c940e4b5 | 33 | #include "map_public.h" |
leuyentran | 0:7fe3c940e4b5 | 34 | |
leuyentran | 0:7fe3c940e4b5 | 35 | // It defines the settings for drawing the map |
leuyentran | 0:7fe3c940e4b5 | 36 | #define SIDE_WALK_COLOR_2 0x999999 |
leuyentran | 0:7fe3c940e4b5 | 37 | #define SIDE_WALK_COLOR 0x198C19 |
leuyentran | 0:7fe3c940e4b5 | 38 | #define LINE_COLOR 0xE5E500 |
leuyentran | 0:7fe3c940e4b5 | 39 | #define CANDY_COLOR 0xFF7F7F |
leuyentran | 0:7fe3c940e4b5 | 40 | #define CANDY_RADIUS 1 |
leuyentran | 0:7fe3c940e4b5 | 41 | #define BIG_CANDY_RADIUS 2 |
leuyentran | 0:7fe3c940e4b5 | 42 | #define WHITE 0xFFFFFF |
leuyentran | 0:7fe3c940e4b5 | 43 | |
leuyentran | 0:7fe3c940e4b5 | 44 | |
leuyentran | 0:7fe3c940e4b5 | 45 | |
leuyentran | 0:7fe3c940e4b5 | 46 | // It defines the values used in the DEFAULT_MAP |
ece2035ta | 6:5ed435a31cc7 | 47 | #define MAP_ATTRIBUTE_SIDE_WALK 0 //side walk |
leuyentran | 0:7fe3c940e4b5 | 48 | #define MAP_ATTRIBUTE_CANDY 1 //candy |
ece2035ta | 6:5ed435a31cc7 | 49 | #define MAP_ATTRIBUTE_BIG_CANDY 2 //big candy |
ece2035ta | 6:5ed435a31cc7 | 50 | #define MAP_ATTRIBUTE_ROAD_L 3 //left side of the road |
ece2035ta | 6:5ed435a31cc7 | 51 | #define MAP_ATTRIBUTE_ROAD 4 //middle of the road |
ece2035ta | 6:5ed435a31cc7 | 52 | #define MAP_ATTRIBUTE_ROAD_R 5 //right side of the road |
ece2035ta | 6:5ed435a31cc7 | 53 | #define MAP_ATTRIBUTE_V_LINE 6 //finish line |
ece2035ta | 6:5ed435a31cc7 | 54 | #define MAP_ATTRIBUTE_SIDE_WALK_2 7 |
leuyentran | 0:7fe3c940e4b5 | 55 | |
leuyentran | 0:7fe3c940e4b5 | 56 | |
leuyentran | 0:7fe3c940e4b5 | 57 | #define DEFAULT_MAP {\ |
ece2035ta | 4:3fb1d198e9d6 | 58 | 0, 0, 0, 7, 3, 1, 5, 3, 4, 5, 3, 1, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 59 | 0, 0, 0, 7, 3, 1, 5, 3, 2, 5, 3, 1, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 60 | 0, 0, 0, 7, 3, 1, 5, 3, 1, 5, 3, 1, 5, 7, 6, 6, 6, \ |
leuyentran | 0:7fe3c940e4b5 | 61 | 0, 0, 0, 7, 3, 4, 5, 3, 4, 5, 3, 4, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 62 | 0, 0, 0, 7, 3, 1, 5, 3, 1, 5, 3, 1, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 63 | 0, 0, 0, 7, 3, 2, 5, 3, 1, 5, 3, 2, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 64 | 0, 0, 0, 7, 3, 1, 5, 3, 1, 5, 3, 1, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 65 | 0, 0, 0, 7, 3, 4, 5, 3, 2, 5, 3, 4, 5, 7, 6, 6, 6, \ |
leuyentran | 0:7fe3c940e4b5 | 66 | 0, 0, 0, 7, 3, 4, 5, 3, 4, 5, 3, 4, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 67 | 0, 0, 0, 7, 3, 2, 5, 3, 1, 5, 3, 2, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 68 | 0, 0, 0, 7, 3, 1, 5, 3, 1, 5, 3, 1, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 69 | 0, 0, 0, 7, 3, 2, 5, 3, 1, 5, 3, 2, 5, 7, 6, 6, 6, \ |
leuyentran | 0:7fe3c940e4b5 | 70 | 0, 0, 0, 7, 3, 4, 5, 3, 4, 5, 3, 4, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 71 | 0, 0, 0, 7, 3, 1, 5, 3, 1, 5, 3, 1, 5, 7, 6, 6, 6, \ |
ece2035ta | 4:3fb1d198e9d6 | 72 | 0, 0, 0, 7, 3, 1, 5, 3, 2, 5, 3, 1, 5, 7, 6, 6, 6, \ |
leuyentran | 0:7fe3c940e4b5 | 73 | 0, 0, 0, 7, 3, 4, 5, 3, 4, 5, 3, 4, 5, 7, 6, 6, 6, } |
leuyentran | 0:7fe3c940e4b5 | 74 | |
leuyentran | 0:7fe3c940e4b5 | 75 | // Here defines some useful macros |
leuyentran | 0:7fe3c940e4b5 | 76 | #define IDX2X(idx) (idx%NUM_GRID_X) |
leuyentran | 0:7fe3c940e4b5 | 77 | #define IDX2Y(idx) (idx/NUM_GRID_X) |
leuyentran | 0:7fe3c940e4b5 | 78 | #define XY2IDX(x,y) (y*NUM_GRID_X+x) |
leuyentran | 0:7fe3c940e4b5 | 79 | |
leuyentran | 0:7fe3c940e4b5 | 80 | void map_draw(void); |
leuyentran | 0:7fe3c940e4b5 | 81 | |
leuyentran | 0:7fe3c940e4b5 | 82 | |
leuyentran | 0:7fe3c940e4b5 | 83 | #endif //MAP_H |