Missile Control Game with uLCD
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed wave_player
Fork of missile_command by
globals.h
- Committer:
- ajindia6
- Date:
- 2015-10-20
- Revision:
- 2:eba4ed0263a4
- Parent:
- 1:3da29f1d84b4
File content as of revision 2:eba4ed0263a4:
#ifndef GLOBAL_H #define GLOBAL_H // === [global object] === extern uLCD_4DGL uLCD; // === [global settings] === #define BACKGROUND_COLOR 0x000000 //black #define LANDSCAPE_HEIGHT 4 // number of pixel on the screen #define MAX_BUILDING_HEIGHT 10 // number of pixel on the screen // === [define the macro of error heandle function] === // when the condition (c) is not true, assert the program and show error code #define ASSERT_P(c,e) do { \ if(!(c)){ \ uLCD.printf("\nERROR:%d\n",e); \ while(1); \ } \ } while (0) // === [error code] === #define ERROR_MISSILE_INDEX_GET_INFO -1 // make sure your code give the valid index for missile_get_info() #define ERROR_MISSILE_INDEX_UPDATE_STATUS -2 // make sure your code give the valid index for missile_update_status() #define ERROR_MISSILE_SPEED -3 // missile speed has to be between 1 and 8 #define ERROR_MISSILE_INTERVAL -4 // missile interval has to be between 1 and 100 // other missile error code ... #define ERROR_CITY_NUMBER -11 // num_city in city_landscape_init() is larger than MAX_NUM_CITY #define ERROR_CITY_INDEX_GET_INFO -12 // make sure your code give the valid index for city_get_info() #define ERROR_CITY_INDEX_DESTROY -13 // make sure your code give the valid index for city_destroy() // other player-missile error code ... #endif //GLOBAL_H