Missile Control Game with uLCD
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed wave_player
Fork of missile_command by
missile/missile_public.h
- Committer:
- ajindia6
- Date:
- 2015-10-20
- Revision:
- 2:eba4ed0263a4
- Parent:
- 0:532cb55d6136
File content as of revision 2:eba4ed0263a4:
#ifndef MISSILE_PUBLIC_H #define MISSILE_PUBLIC_H ///The missile status typedef enum { MISSILE_EXPLODED=2,///<missile has been destroyed MISSILE_ACTIVE=1,///<missile is active MISSILE_DEACTIVE=0///<missile is no longer active } MISSILE_STATUS; /// The structure to store the information of a missile typedef struct { int x; ///< The x-coordinate of missile current position int y; ///< The y-coordinate of missile current position double source_x; ///< The x-coordinate of the missile's origin double target_x; ///< The x-coordinate of the missile's target int tick; ///< The missile's internal tick MISSILE_STATUS status; ///< The missile status, see MISSILE_STATUS } MISSILE; #define MAX_NUM_MISSILE 5 /** This function draw the missiles onto the screen Call missile_generator() repeatedly in your game-loop. ex: main() */ void missile_generator(void); /** The function set the status of missile to be MISSILE_EXPLODED @param index The index in missile_record. It must be smaller than MAX_NUM_MISSILE. */ void missile_set_exploded(int index); /** Get the information of a missile @param index The index in missile_record. It must be smaller than MAX_NUM_MISSILE. @return The structure of missile information */ MISSILE missile_get_info(int index); /** Set the speed of missiles, Speed has range of 1-8 with 1 being fastest and 8 being slowest */ void set_missile_speed(int speed); /** Set the interval that the missiles fire, interval has range of 1-100 with 1 being fired in very quick succession and 100 being fired very slowly after one another */ void set_missile_interval(int interval); void missile_draw(MISSILE missile, int color); #endif //MISSILE_PUBLIC_H