ECE 4180 Single Player Space Invaders Team / Mbed 2 deprecated Mbed-Space-Invaders4

Dependencies:   mbed wave_player mbed-rtos 4DGL-uLCD-SE SDFileSystem

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers enemy.h Source File

enemy.h

00001 #ifndef ENEMY_H
00002 #define ENEMY_H
00003 
00004 #include "mbed.h"
00005 #include "enemy.h"
00006 #include "missile.h"
00007 #include "globals.h"
00008 
00009 extern uLCD_4DGL uLCD;
00010 
00011 // Enemy Status
00012 typedef enum {
00013     ENEMY_DEAD = 0,
00014     ENEMY_ALIVE = 1
00015 } ENEMY_STATUS;
00016 
00017 /// This struct contains the status of a enemy
00018 typedef struct
00019 {
00020     int enemy_blk_x;   ///< horizontal position in the grid
00021     int enemy_blk_y;   ///< vertical position in the grid
00022     int enemy_old_blk_x; ///< old horizontal position in the grid
00023     int enemy_old_blk_y; ///< old vertical position in the grid
00024     int enemy_width;
00025     int enemy_height;
00026     int enemy_color;   ///< color of the enemy
00027     ENEMY_STATUS status;
00028 } enemy_t;
00029 
00030 void enemy_init(enemy_t * g, unsigned int blk_x, unsigned int blk_y, unsigned int color);
00031 void enemy_show(enemy_t *g);
00032 void enemy_erase(enemy_t *g);
00033 int check_enemy(enemy_t *g, missile_t *h);
00034 int move_enemy(enemy_t *g, int MOVE_DOWN, int DIRECTION);
00035 
00036 #endif //ENEMY_H