pocket tanks

Dependencies:   4DGL-uLCD-SE pockettanks SDFileSystem mbed wave_player

Fork of ECE2035_FroggerGame_SUM1025 by Le Tran

Committer:
ece2035ta
Date:
Thu Oct 22 03:47:32 2015 +0000
Revision:
3:8f68c00dd75a
Parent:
1:172fbc00199c
hi

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 #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
ece2035ta 1:172fbc00199c 36 #define SIDE_WALK_COLOR_2 0x00ffdf //SKy blue
ece2035ta 1:172fbc00199c 37 #define SIDE_WALK_COLOR 0x198C19 // green
ece2035ta 3:8f68c00dd75a 38 #define LINE_COLOR 0x674529
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
leuyentran 0:7fe3c940e4b5 47 #define MAP_ATTRIBUTE_SIDE_WALK 0 //side walk
leuyentran 0:7fe3c940e4b5 48 #define MAP_ATTRIBUTE_CANDY 1 //candy
leuyentran 0:7fe3c940e4b5 49 #define MAP_ATTRIBUTE_BIG_CANDY 2 //big candy
ece2035ta 3:8f68c00dd75a 50 #define MAP_ATTRIBUTE_ROAD_L 4
ece2035ta 3:8f68c00dd75a 51 #define MAP_ATTRIBUTE_ROAD 3
leuyentran 0:7fe3c940e4b5 52 #define MAP_ATTRIBUTE_ROAD_R 5
leuyentran 0:7fe3c940e4b5 53 #define MAP_ATTRIBUTE_V_LINE 6
ece2035ta 3:8f68c00dd75a 54 #define MAP_ATTRIBUTE_SIDE_WALK_2 7 //green
leuyentran 0:7fe3c940e4b5 55
leuyentran 0:7fe3c940e4b5 56
ece2035ta 1:172fbc00199c 57
ece2035ta 1:172fbc00199c 58 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 59 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 60 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 61 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 62 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 63 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 64 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 65 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 66 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 67 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 68 //0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
ece2035ta 1:172fbc00199c 69 //7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 1:172fbc00199c 70 //7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 1:172fbc00199c 71 //7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 1:172fbc00199c 72 //7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 1:172fbc00199c 73 //7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, }
leuyentran 0:7fe3c940e4b5 74 #define DEFAULT_MAP {\
ece2035ta 3:8f68c00dd75a 75 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 76 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 77 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 78 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 79 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 80 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 81 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 82 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 83 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 84 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 85 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 86 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 87 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 88 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, }
ece2035ta 3:8f68c00dd75a 89
ece2035ta 3:8f68c00dd75a 90
ece2035ta 3:8f68c00dd75a 91 /*#define DEFAULT_MAP {\
ece2035ta 3:8f68c00dd75a 92 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 93 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 94 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 95 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 96 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 97 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 98 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 99 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 100 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 101 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 102 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 103 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 104 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 105 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, \
ece2035ta 3:8f68c00dd75a 106 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, } */
leuyentran 0:7fe3c940e4b5 107 // Here defines some useful macros
leuyentran 0:7fe3c940e4b5 108 #define IDX2X(idx) (idx%NUM_GRID_X)
leuyentran 0:7fe3c940e4b5 109 #define IDX2Y(idx) (idx/NUM_GRID_X)
leuyentran 0:7fe3c940e4b5 110 #define XY2IDX(x,y) (y*NUM_GRID_X+x)
leuyentran 0:7fe3c940e4b5 111
leuyentran 0:7fe3c940e4b5 112 void map_draw(void);
leuyentran 0:7fe3c940e4b5 113
leuyentran 0:7fe3c940e4b5 114
leuyentran 0:7fe3c940e4b5 115 #endif //MAP_H