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 missile_public.h Source File

missile_public.h

00001 #ifndef MISSILE_PUBLIC_H
00002 #define MISSILE_PUBLIC_H
00003 
00004 ///The missile status
00005 typedef enum {
00006     MISSILE_EXPLODED=2,///<missile has been destroyed
00007     MISSILE_ACTIVE=1,///<missile is active
00008     MISSILE_DEACTIVE=0///<missile is no longer active
00009 } MISSILE_STATUS;
00010 
00011 
00012 /// The structure to store the information of a missile
00013 typedef struct {
00014     int x;                   ///< The x-coordinate of missile current position
00015     int y;                   ///< The y-coordinate of missile current position
00016     double source_x;           ///< The x-coordinate of the missile's origin
00017     double target_x;           ///< The x-coordinate of the missile's target
00018     int tick;                  ///< The missile's internal tick
00019     MISSILE_STATUS status;   ///< The missile status, see MISSILE_STATUS
00020 } MISSILE;
00021 
00022 #define MAX_NUM_MISSILE  5
00023 
00024 /** This function draw the missiles onto the screen
00025     Call missile_generator() repeatedly in your game-loop. ex: main()
00026 */
00027 void missile_generator(void);
00028 
00029 /** The function set the status of missile to be MISSILE_EXPLODED
00030     @param index The index in missile_record. It must be smaller than MAX_NUM_MISSILE.
00031 */
00032 void missile_set_exploded(int index);
00033 
00034 /** Get the information of a missile
00035     @param index The index in missile_record. It must be smaller than MAX_NUM_MISSILE.
00036     @return The structure of missile information
00037 */
00038 MISSILE missile_get_info(int index);
00039 
00040 /** Set the speed of missiles, Speed has range of 1-8 with 1 being fastest and 8 being slowest
00041 */
00042 void set_missile_speed(int speed);
00043 
00044 /** Set the interval that the missiles fire, interval has range of 1-100 with 1 being fired in
00045     very quick succession and 100 being fired very slowly after one another
00046 */
00047 void set_missile_interval(int interval);
00048 
00049 void missile_draw(MISSILE missile, int color);
00050 
00051 #endif //MISSILE_PUBLIC_H