Missile Control Game with uLCD
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed wave_player
Fork of missile_command by
globals.h@2:eba4ed0263a4, 2015-10-20 (annotated)
- Committer:
- ajindia6
- Date:
- Tue Oct 20 19:13:03 2015 +0000
- Revision:
- 2:eba4ed0263a4
- Parent:
- 1:3da29f1d84b4
Mbed Mission Control Game
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
arvahsu | 0:532cb55d6136 | 1 | #ifndef GLOBAL_H |
arvahsu | 0:532cb55d6136 | 2 | #define GLOBAL_H |
arvahsu | 0:532cb55d6136 | 3 | |
arvahsu | 0:532cb55d6136 | 4 | // === [global object] === |
arvahsu | 0:532cb55d6136 | 5 | extern uLCD_4DGL uLCD; |
arvahsu | 0:532cb55d6136 | 6 | |
arvahsu | 0:532cb55d6136 | 7 | |
arvahsu | 0:532cb55d6136 | 8 | // === [global settings] === |
arvahsu | 0:532cb55d6136 | 9 | #define BACKGROUND_COLOR 0x000000 //black |
arvahsu | 0:532cb55d6136 | 10 | #define LANDSCAPE_HEIGHT 4 // number of pixel on the screen |
arvahsu | 0:532cb55d6136 | 11 | #define MAX_BUILDING_HEIGHT 10 // number of pixel on the screen |
arvahsu | 0:532cb55d6136 | 12 | |
arvahsu | 0:532cb55d6136 | 13 | |
arvahsu | 0:532cb55d6136 | 14 | // === [define the macro of error heandle function] === |
arvahsu | 0:532cb55d6136 | 15 | // when the condition (c) is not true, assert the program and show error code |
arvahsu | 0:532cb55d6136 | 16 | #define ASSERT_P(c,e) do { \ |
arvahsu | 0:532cb55d6136 | 17 | if(!(c)){ \ |
arvahsu | 0:532cb55d6136 | 18 | uLCD.printf("\nERROR:%d\n",e); \ |
arvahsu | 0:532cb55d6136 | 19 | while(1); \ |
arvahsu | 0:532cb55d6136 | 20 | } \ |
arvahsu | 0:532cb55d6136 | 21 | } while (0) |
arvahsu | 0:532cb55d6136 | 22 | |
arvahsu | 0:532cb55d6136 | 23 | |
arvahsu | 0:532cb55d6136 | 24 | // === [error code] === |
arvahsu | 0:532cb55d6136 | 25 | #define ERROR_MISSILE_INDEX_GET_INFO -1 // make sure your code give the valid index for missile_get_info() |
arvahsu | 0:532cb55d6136 | 26 | #define ERROR_MISSILE_INDEX_UPDATE_STATUS -2 // make sure your code give the valid index for missile_update_status() |
arvahsu | 0:532cb55d6136 | 27 | #define ERROR_MISSILE_SPEED -3 // missile speed has to be between 1 and 8 |
arvahsu | 0:532cb55d6136 | 28 | #define ERROR_MISSILE_INTERVAL -4 // missile interval has to be between 1 and 100 |
arvahsu | 0:532cb55d6136 | 29 | // other missile error code ... |
arvahsu | 0:532cb55d6136 | 30 | #define ERROR_CITY_NUMBER -11 // num_city in city_landscape_init() is larger than MAX_NUM_CITY |
arvahsu | 0:532cb55d6136 | 31 | #define ERROR_CITY_INDEX_GET_INFO -12 // make sure your code give the valid index for city_get_info() |
arvahsu | 1:3da29f1d84b4 | 32 | #define ERROR_CITY_INDEX_DESTROY -13 // make sure your code give the valid index for city_destroy() |
arvahsu | 0:532cb55d6136 | 33 | // other player-missile error code ... |
arvahsu | 0:532cb55d6136 | 34 | |
arvahsu | 0:532cb55d6136 | 35 | #endif //GLOBAL_H |