Arnav Jindia / Mbed 2 deprecated Missile_Control_Game

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed wave_player

Fork of missile_command by ECE 2035 TA

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers player.h Source File

player.h

00001 // Template of player header file
00002 #ifndef PLAYER_H
00003 #define PLAYER_H
00004 
00005 // Player settings
00006 #define PLAYER_WIDTH   10 
00007 #define PLAYER_HEIGHT  3
00008 #define PLAYER_DELTA   3
00009 #define PLAYER_COLOR   0x0000FF
00010 #define BLACK_COLOR    0x000000
00011 #define YELLOW_COLOR   0xFFFF00  
00012 #define GREEN_COLOR    0x00FF00
00013 
00014 
00015 
00016 
00017 typedef enum {
00018     PLAYER_MISSILE_EXPLODED=2,///<missile has been destroyed
00019     PLAYER_MISSILE_ACTIVE=1,///<missile is active
00020     PLAYER_MISSILE_DEACTIVE=0///<missile is no longer active
00021 } PLAYER_MISSILE_STATUS;
00022 //Initialize ANTI-missile structure
00023 
00024 typedef struct {
00025     int x;   
00026     int origin_y;                ///< The x-coordinate of missile current position
00027     int y;                   ///< The y-coordinate of missile current position
00028     int source_x;
00029     int source_y;                 
00030     PLAYER_MISSILE_STATUS status;   ///< The missile status, see MISSILE_STATUS
00031     
00032 } PLAYER_MISSILE;
00033 //Initialize PLAYER structure
00034 typedef struct {
00035     int x;
00036     int y;
00037     int numMissile;
00038     int lives;   
00039      
00040             
00041     } PLAYER;
00042 //Declare functions
00043 void player_missile_draw(PLAYER_MISSILE player_missile, int color);
00044 void player_draw(int x, int y);
00045 void player_delete(int x, int y);
00046 void missile_start(int counter);
00047 void player_set_exploded(int index);
00048 void gameover(int s);
00049 
00050 #endif //PLAYER_H