IMU is outputting garbage value to the terminal
Dependencies: mbed wave_player mbed-rtos 4DGL-uLCD-SE SDFileSystem
enemy.h@0:3817adfaeb06, 2016-03-15 (annotated)
- Committer:
- michaeljson
- Date:
- Tue Mar 15 19:09:51 2016 +0000
- Revision:
- 0:3817adfaeb06
Upload Mbed Space Invader version 1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
michaeljson | 0:3817adfaeb06 | 1 | #ifndef ENEMY_H |
michaeljson | 0:3817adfaeb06 | 2 | #define ENEMY_H |
michaeljson | 0:3817adfaeb06 | 3 | |
michaeljson | 0:3817adfaeb06 | 4 | #include "mbed.h" |
michaeljson | 0:3817adfaeb06 | 5 | #include "enemy.h" |
michaeljson | 0:3817adfaeb06 | 6 | #include "missile.h" |
michaeljson | 0:3817adfaeb06 | 7 | #include "globals.h" |
michaeljson | 0:3817adfaeb06 | 8 | |
michaeljson | 0:3817adfaeb06 | 9 | extern uLCD_4DGL uLCD; |
michaeljson | 0:3817adfaeb06 | 10 | |
michaeljson | 0:3817adfaeb06 | 11 | // Enemy Status |
michaeljson | 0:3817adfaeb06 | 12 | typedef enum { |
michaeljson | 0:3817adfaeb06 | 13 | ENEMY_DEAD = 0, |
michaeljson | 0:3817adfaeb06 | 14 | ENEMY_ALIVE = 1 |
michaeljson | 0:3817adfaeb06 | 15 | } ENEMY_STATUS; |
michaeljson | 0:3817adfaeb06 | 16 | |
michaeljson | 0:3817adfaeb06 | 17 | /// This struct contains the status of a enemy |
michaeljson | 0:3817adfaeb06 | 18 | typedef struct |
michaeljson | 0:3817adfaeb06 | 19 | { |
michaeljson | 0:3817adfaeb06 | 20 | int enemy_blk_x; ///< horizontal position in the grid |
michaeljson | 0:3817adfaeb06 | 21 | int enemy_blk_y; ///< vertical position in the grid |
michaeljson | 0:3817adfaeb06 | 22 | int enemy_old_blk_x; ///< old horizontal position in the grid |
michaeljson | 0:3817adfaeb06 | 23 | int enemy_old_blk_y; ///< old vertical position in the grid |
michaeljson | 0:3817adfaeb06 | 24 | int enemy_width; |
michaeljson | 0:3817adfaeb06 | 25 | int enemy_height; |
michaeljson | 0:3817adfaeb06 | 26 | int enemy_color; ///< color of the enemy |
michaeljson | 0:3817adfaeb06 | 27 | ENEMY_STATUS status; |
michaeljson | 0:3817adfaeb06 | 28 | } enemy_t; |
michaeljson | 0:3817adfaeb06 | 29 | |
michaeljson | 0:3817adfaeb06 | 30 | void enemy_init(enemy_t * g, unsigned int blk_x, unsigned int blk_y, unsigned int color); |
michaeljson | 0:3817adfaeb06 | 31 | void enemy_show(enemy_t *g); |
michaeljson | 0:3817adfaeb06 | 32 | void enemy_erase(enemy_t *g); |
michaeljson | 0:3817adfaeb06 | 33 | int check_enemy(enemy_t *g, missile_t *h); |
michaeljson | 0:3817adfaeb06 | 34 | int move_enemy(enemy_t *g, int MOVE_DOWN, int DIRECTION); |
michaeljson | 0:3817adfaeb06 | 35 | |
michaeljson | 0:3817adfaeb06 | 36 | #endif //ENEMY_H |