My ELEC2645 project. Nikollao Sulollari. 200804685
Dependencies: N5110 SoftPWM mbed
Fork of Treasure_Hunt by
Diff: main.h
- Revision:
- 4:f31bdc212241
- Parent:
- 3:d2cc054e8605
- Child:
- 5:ffa498d7071f
diff -r d2cc054e8605 -r f31bdc212241 main.h --- a/main.h Mon Mar 21 11:36:51 2016 +0000 +++ b/main.h Thu Mar 24 11:46:35 2016 +0000 @@ -6,31 +6,11 @@ InterruptIn sw2(SW2); InterruptIn sw3(SW3); -#define DIRECTION_TOLERANCE 0.05 - InterruptIn button(PTB2); AnalogIn xPot(PTB3); AnalogIn yPot(PTB10); PwmOut speaker(PTC11); - -volatile int rectY; -volatile int rectX ; -volatile int circleX; -volatile int circleY; -volatile int heroX; -volatile int heroY; - -volatile int level = 0; -volatile int count = 0; -volatile int reset = 0; -volatile int g_timer_flag = 0; -volatile int g_game_timer_flag = 0; -volatile int g_sw2_flag = 0; -volatile int g_sw3_flag = 0; -volatile int g_button_flag = 0; -volatile int option = 0; - void error(); // setup serial port void init_serial(); @@ -54,17 +34,25 @@ void obstacles(); void enemies(); int menu(); -int intersection(int i, int j); +bool intersection(int i, int j); + +volatile int rectY; +volatile int rectX ; +volatile int circleX; +volatile int circleY; +volatile int heroX; +volatile int heroY; -enum DirectionName { - UP, - DOWN, - LEFT, - RIGHT, - CENTRE, - UP_LEFT, - UP_RIGHT, - DOWN_LEFT, - DOWN_RIGHT -}; +volatile int level = 0; +volatile int g_timer_flag = 0; +volatile int g_game_timer_flag = 0; +volatile int g_sw2_flag = 0; +volatile int g_sw3_flag = 0; +volatile int g_button_flag = 0; +volatile int option = 0; +volatile int play = 0; +int reset = 0; + + +