Updated Space Invaders on the mbed. Improved upon Michael Son's "Mbed Space Invaders" at https://os.mbed.com/users/michaeljson/notebook/mbed-space-invaders/.

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

Fork of Two-PlayerSpaceInvaders by William Minix

test

Committer:
wminix3
Date:
Thu Apr 29 05:41:40 2021 +0000
Revision:
33:d17d71103d41
Parent:
26:3270c6edd7d9
Fixed score.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
michaeljson 0:3817adfaeb06 1 #ifndef missile_H
michaeljson 0:3817adfaeb06 2 #define missile_H
michaeljson 0:3817adfaeb06 3
michaeljson 0:3817adfaeb06 4 #include "mbed.h"
michaeljson 0:3817adfaeb06 5 #include "missile.h"
michaeljson 0:3817adfaeb06 6
michaeljson 0:3817adfaeb06 7
michaeljson 0:3817adfaeb06 8 #include "globals.h"
michaeljson 0:3817adfaeb06 9
michaeljson 0:3817adfaeb06 10 extern uLCD_4DGL uLCD;
michaeljson 0:3817adfaeb06 11
michaeljson 0:3817adfaeb06 12 // Enumeration of Missile Status
michaeljson 0:3817adfaeb06 13 typedef enum {
michaeljson 0:3817adfaeb06 14 PLAYER_MISSILE_ACTIVE=0, // missile is active
michaeljson 0:3817adfaeb06 15 PLAYER_MISSILE_INACTIVE=1, // missile is inactive
michaeljson 0:3817adfaeb06 16 PLAYER_MISSILE_EXPLODED=2, // missile has been destroyed
michaeljson 0:3817adfaeb06 17 ENEMY_MISSILE_ACTIVE=3, // missile is active
michaeljson 0:3817adfaeb06 18 ENEMY_MISSILE_INACTIVE=4, // missile is inactive
michaeljson 0:3817adfaeb06 19 ENEMY_MISSILE_EXPLODED=5 // missile has been destroyed
michaeljson 0:3817adfaeb06 20 } PLAYER_MISSILE_STATUS;
michaeljson 0:3817adfaeb06 21
michaeljson 0:3817adfaeb06 22 /// This struct contains the status of a missile
michaeljson 0:3817adfaeb06 23 typedef struct
michaeljson 0:3817adfaeb06 24 {
michaeljson 0:3817adfaeb06 25 int missile_blk_x; ///< horizontal position in the grid
michaeljson 0:3817adfaeb06 26 int missile_blk_y; ///< vertical position in the grid
michaeljson 0:3817adfaeb06 27 unsigned int missile_old_blk_x; ///< old horizontal position in the grid
michaeljson 0:3817adfaeb06 28 unsigned int missile_old_blk_y; ///< old vertical position in the grid
michaeljson 0:3817adfaeb06 29 int missile_width;
michaeljson 0:3817adfaeb06 30 int missile_height;
michaeljson 0:3817adfaeb06 31 int missile_color; ///< color of the missile
michaeljson 0:3817adfaeb06 32 PLAYER_MISSILE_STATUS status;
michaeljson 0:3817adfaeb06 33 } missile_t;
michaeljson 0:3817adfaeb06 34
michaeljson 0:3817adfaeb06 35 void missile_init(missile_t * g, int blk_x, int blk_y, int color);
michaeljson 0:3817adfaeb06 36 void enemy_missile_init(missile_t * g, int blk_x, int blk_y, int color);
michaeljson 0:3817adfaeb06 37 void missile_show(missile_t *g);
michaeljson 0:3817adfaeb06 38 void missile_erase(missile_t *g);
michaeljson 0:3817adfaeb06 39 void update_missile_pos(missile_t *g);
wminix3 26:3270c6edd7d9 40 void update_enemy_missile_pos(missile_t *g, int level);
michaeljson 0:3817adfaeb06 41
michaeljson 0:3817adfaeb06 42 #endif //missile_H