This code contains the game Starship designed for the STM32F429i-DISC1 board. It requires a keyboard to play.

Dependencies:   Starship LCD_DISCO_F429ZI USBHost mbed

Dependents:   Starship

Committer:
Oshyrath
Date:
Fri Nov 17 02:23:33 2017 +0000
Revision:
1:527a11035e0b
Parent:
0:c9afe145b57b
First Publish of the code.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Oshyrath 0:c9afe145b57b 1 #ifndef __ENEMY_UNIT
Oshyrath 0:c9afe145b57b 2 #define __ENEMY_UNIT
Oshyrath 0:c9afe145b57b 3 #include "Constants.h"
Oshyrath 0:c9afe145b57b 4 #include <stdint.h>
Oshyrath 0:c9afe145b57b 5
Oshyrath 0:c9afe145b57b 6 struct Enemy
Oshyrath 0:c9afe145b57b 7 {
Oshyrath 0:c9afe145b57b 8 struct Enemy * prev;
Oshyrath 0:c9afe145b57b 9 struct Enemy * next;
Oshyrath 1:527a11035e0b 10 int16_t x_pos;
Oshyrath 1:527a11035e0b 11 int16_t y_pos;
Oshyrath 1:527a11035e0b 12 int16_t x_vel;
Oshyrath 1:527a11035e0b 13 int16_t y_vel;
Oshyrath 1:527a11035e0b 14 int16_t health;
Oshyrath 1:527a11035e0b 15 int16_t maxHealth;
Oshyrath 1:527a11035e0b 16 int16_t freezeTimer;
Oshyrath 1:527a11035e0b 17 int16_t gunTimer;
Oshyrath 0:c9afe145b57b 18 };
Oshyrath 0:c9afe145b57b 19
Oshyrath 1:527a11035e0b 20 extern struct Enemy * enemyPTR;
Oshyrath 1:527a11035e0b 21 extern int16_t enemyCount;
Oshyrath 0:c9afe145b57b 22
Oshyrath 1:527a11035e0b 23 //User interface functions.
Oshyrath 1:527a11035e0b 24 void addEnemy(int16_t x_pos, int16_t x_vel,int16_t y_vel, int16_t health);
Oshyrath 1:527a11035e0b 25 void clearEnemies();
Oshyrath 1:527a11035e0b 26 void freezeEnemies();
Oshyrath 1:527a11035e0b 27 int16_t getEnemyBulletPos(struct Enemy * enemy,int8_t XOrY);
Oshyrath 1:527a11035e0b 28 int8_t dealDamageToEnemy(struct Enemy * enemy, int8_t damage);
Oshyrath 1:527a11035e0b 29 void callMultiFuncEnemy();
Oshyrath 1:527a11035e0b 30
Oshyrath 1:527a11035e0b 31 //Functions user does not need to worry about.
Oshyrath 0:c9afe145b57b 32 void removeEnemy(struct Enemy * removePTR);
Oshyrath 0:c9afe145b57b 33 void enemyMovement(struct Enemy * enemy);
Oshyrath 0:c9afe145b57b 34 void enemyMovement_ALL();//mf
Oshyrath 0:c9afe145b57b 35 void updateEnemyTimers(struct Enemy * enemy);
Oshyrath 0:c9afe145b57b 36 void updateEnemyTimers_ALL();//mf
Oshyrath 0:c9afe145b57b 37 void removeEnemyIfOOB(struct Enemy * enemy);
Oshyrath 0:c9afe145b57b 38 void removeEnemyIfOOB_ALL(); //mf
Oshyrath 0:c9afe145b57b 39
Oshyrath 0:c9afe145b57b 40
Oshyrath 0:c9afe145b57b 41 #endif