Sizhe Lin / Mbed 2 deprecated missile_command_Sizhe_Lin

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed wave_player

Fork of missile_command by ECE 2035 TA

Committer:
arvahsu
Date:
Wed Oct 29 01:21:34 2014 +0000
Revision:
0:532cb55d6136
Child:
2:d39a6a36e0c0
First public version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
arvahsu 0:532cb55d6136 1 /* Gatech ECE2035 2014 FALL missile command
arvahsu 0:532cb55d6136 2 * Copyright (c) 2014 Gatech ECE2035
arvahsu 0:532cb55d6136 3 *
arvahsu 0:532cb55d6136 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
arvahsu 0:532cb55d6136 5 * of this software and associated documentation files (the "Software"), to deal
arvahsu 0:532cb55d6136 6 * in the Software without restriction, including without limitation the rights
arvahsu 0:532cb55d6136 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
arvahsu 0:532cb55d6136 8 * copies of the Software, and to permit persons to whom the Software is
arvahsu 0:532cb55d6136 9 * furnished to do so, subject to the following conditions:
arvahsu 0:532cb55d6136 10 *
arvahsu 0:532cb55d6136 11 * The above copyright notice and this permission notice shall be included in
arvahsu 0:532cb55d6136 12 * all copies or substantial portions of the Software.
arvahsu 0:532cb55d6136 13 *
arvahsu 0:532cb55d6136 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
arvahsu 0:532cb55d6136 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
arvahsu 0:532cb55d6136 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
arvahsu 0:532cb55d6136 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
arvahsu 0:532cb55d6136 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
arvahsu 0:532cb55d6136 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
arvahsu 0:532cb55d6136 20 * SOFTWARE.
arvahsu 0:532cb55d6136 21 */
arvahsu 0:532cb55d6136 22 /** @file missile_public.h */
arvahsu 0:532cb55d6136 23 #ifndef MISSILE_PUBLIC_H
arvahsu 0:532cb55d6136 24 #define MISSILE_PUBLIC_H
arvahsu 0:532cb55d6136 25
arvahsu 0:532cb55d6136 26 ///The missile status
arvahsu 0:532cb55d6136 27 typedef enum {
arvahsu 0:532cb55d6136 28 MISSILE_EXPLODED=2,///<missile has been destroyed
arvahsu 0:532cb55d6136 29 MISSILE_ACTIVE=1,///<missile is active
arvahsu 0:532cb55d6136 30 MISSILE_DEACTIVE=0///<missile is no longer active
arvahsu 0:532cb55d6136 31 } MISSILE_STATUS;
arvahsu 0:532cb55d6136 32
arvahsu 0:532cb55d6136 33 /// The structure to store the information of a missile
arvahsu 0:532cb55d6136 34 typedef struct {
arvahsu 0:532cb55d6136 35 int x; ///< The x-coordinate of missile current position
arvahsu 0:532cb55d6136 36 int y; ///< The y-coordinate of missile current position
arvahsu 0:532cb55d6136 37 double source_x; ///< The x-coordinate of the missile's origin
arvahsu 0:532cb55d6136 38 double target_x; ///< The x-coordinate of the missile's target
arvahsu 0:532cb55d6136 39 int tick; ///< The missile's internal tick
arvahsu 0:532cb55d6136 40 MISSILE_STATUS status; ///< The missile status, see MISSILE_STATUS
arvahsu 0:532cb55d6136 41 } MISSILE;
arvahsu 0:532cb55d6136 42
arvahsu 0:532cb55d6136 43 #define MAX_NUM_MISSILE 5
arvahsu 0:532cb55d6136 44
arvahsu 0:532cb55d6136 45 /** This function draw the missiles onto the screen
arvahsu 0:532cb55d6136 46 Call missile_generator() repeatedly in your game-loop. ex: main()
arvahsu 0:532cb55d6136 47 */
arvahsu 0:532cb55d6136 48 void missile_generator(void);
arvahsu 0:532cb55d6136 49
arvahsu 0:532cb55d6136 50 /** The function set the status of missile to be MISSILE_EXPLODED
arvahsu 0:532cb55d6136 51 @param index The index in missile_record. It must be smaller than MAX_NUM_MISSILE.
arvahsu 0:532cb55d6136 52 */
arvahsu 0:532cb55d6136 53 void missile_set_exploded(int index);
arvahsu 0:532cb55d6136 54
arvahsu 0:532cb55d6136 55 /** Get the information of a missile
arvahsu 0:532cb55d6136 56 @param index The index in missile_record. It must be smaller than MAX_NUM_MISSILE.
arvahsu 0:532cb55d6136 57 @return The structure of missile information
arvahsu 0:532cb55d6136 58 */
arvahsu 0:532cb55d6136 59 MISSILE missile_get_info(int index);
arvahsu 0:532cb55d6136 60
arvahsu 0:532cb55d6136 61 /** Set the speed of missiles, Speed has range of 1-8 with 1 being fastest and 8 being slowest
arvahsu 0:532cb55d6136 62 */
arvahsu 0:532cb55d6136 63 void set_missile_speed(int speed);
arvahsu 0:532cb55d6136 64
arvahsu 0:532cb55d6136 65 /** Set the interval that the missiles fire, interval has range of 1-100 with 1 being fired in
arvahsu 0:532cb55d6136 66 very quick succession and 100 being fired very slowly after one another
arvahsu 0:532cb55d6136 67 */
arvahsu 0:532cb55d6136 68 void set_missile_interval(int interval);
arvahsu 0:532cb55d6136 69
arvahsu 0:532cb55d6136 70 #endif //MISSILE_PUBLIC_H