2035

Dependencies:   4DGL-uLCD-SE mbed wave_player

Fork of missile_command by ECE 2035 TA

Committer:
tianyeapply
Date:
Wed Nov 09 17:04:42 2016 +0000
Revision:
3:7e33224a6f1d
Parent:
1:3da29f1d84b4

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
arvahsu 0:532cb55d6136 1 /* Gatech ECE2035 2014 FALL missile command
arvahsu 0:532cb55d6136 2 * Copyright (c) 2014 Gatech ECE2035
arvahsu 0:532cb55d6136 3 *
arvahsu 0:532cb55d6136 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
arvahsu 0:532cb55d6136 5 * of this software and associated documentation files (the "Software"), to deal
arvahsu 0:532cb55d6136 6 * in the Software without restriction, including without limitation the rights
arvahsu 0:532cb55d6136 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
arvahsu 0:532cb55d6136 8 * copies of the Software, and to permit persons to whom the Software is
arvahsu 0:532cb55d6136 9 * furnished to do so, subject to the following conditions:
arvahsu 0:532cb55d6136 10 *
arvahsu 0:532cb55d6136 11 * The above copyright notice and this permission notice shall be included in
arvahsu 0:532cb55d6136 12 * all copies or substantial portions of the Software.
arvahsu 0:532cb55d6136 13 *
arvahsu 0:532cb55d6136 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
arvahsu 0:532cb55d6136 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
arvahsu 0:532cb55d6136 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
arvahsu 0:532cb55d6136 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
arvahsu 0:532cb55d6136 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
arvahsu 0:532cb55d6136 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
arvahsu 0:532cb55d6136 20 * SOFTWARE.
arvahsu 0:532cb55d6136 21 */
arvahsu 0:532cb55d6136 22 #ifndef GLOBAL_H
arvahsu 0:532cb55d6136 23 #define GLOBAL_H
arvahsu 0:532cb55d6136 24
arvahsu 0:532cb55d6136 25 // === [global object] ===
arvahsu 0:532cb55d6136 26 extern uLCD_4DGL uLCD;
arvahsu 0:532cb55d6136 27
arvahsu 0:532cb55d6136 28
arvahsu 0:532cb55d6136 29 // === [global settings] ===
arvahsu 0:532cb55d6136 30 #define BACKGROUND_COLOR 0x000000 //black
arvahsu 0:532cb55d6136 31 #define LANDSCAPE_HEIGHT 4 // number of pixel on the screen
arvahsu 0:532cb55d6136 32 #define MAX_BUILDING_HEIGHT 10 // number of pixel on the screen
arvahsu 0:532cb55d6136 33
arvahsu 0:532cb55d6136 34
arvahsu 0:532cb55d6136 35 // === [define the macro of error heandle function] ===
arvahsu 0:532cb55d6136 36 // when the condition (c) is not true, assert the program and show error code
arvahsu 0:532cb55d6136 37 #define ASSERT_P(c,e) do { \
arvahsu 0:532cb55d6136 38 if(!(c)){ \
arvahsu 0:532cb55d6136 39 uLCD.printf("\nERROR:%d\n",e); \
arvahsu 0:532cb55d6136 40 while(1); \
arvahsu 0:532cb55d6136 41 } \
arvahsu 0:532cb55d6136 42 } while (0)
arvahsu 0:532cb55d6136 43
arvahsu 0:532cb55d6136 44
arvahsu 0:532cb55d6136 45 // === [error code] ===
arvahsu 0:532cb55d6136 46 #define ERROR_MISSILE_INDEX_GET_INFO -1 // make sure your code give the valid index for missile_get_info()
arvahsu 0:532cb55d6136 47 #define ERROR_MISSILE_INDEX_UPDATE_STATUS -2 // make sure your code give the valid index for missile_update_status()
arvahsu 0:532cb55d6136 48 #define ERROR_MISSILE_SPEED -3 // missile speed has to be between 1 and 8
arvahsu 0:532cb55d6136 49 #define ERROR_MISSILE_INTERVAL -4 // missile interval has to be between 1 and 100
arvahsu 0:532cb55d6136 50 // other missile error code ...
arvahsu 0:532cb55d6136 51 #define ERROR_CITY_NUMBER -11 // num_city in city_landscape_init() is larger than MAX_NUM_CITY
arvahsu 0:532cb55d6136 52 #define ERROR_CITY_INDEX_GET_INFO -12 // make sure your code give the valid index for city_get_info()
arvahsu 1:3da29f1d84b4 53 #define ERROR_CITY_INDEX_DESTROY -13 // make sure your code give the valid index for city_destroy()
arvahsu 0:532cb55d6136 54 // other player-missile error code ...
arvahsu 0:532cb55d6136 55
arvahsu 0:532cb55d6136 56 #endif //GLOBAL_H