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

Enemy.h

Committer:
Oshyrath
Date:
2017-09-17
Revision:
0:c9afe145b57b
Child:
1:527a11035e0b

File content as of revision 0:c9afe145b57b:

#ifndef __ENEMY_UNIT
#define __ENEMY_UNIT
#include "Constants.h"
#include <stdint.h>

struct Enemy
{
    struct Enemy * prev;
    struct Enemy * next;
    uint16_t x_pos;
    uint16_t y_pos;
    uint16_t x_vel;
    uint16_t y_vel;
    uint16_t health;
    uint16_t freezeTimer;
    uint16_t gunTimer;
};

static struct Enemy * enemyPTR;
static uint16_t enemyCount;

//Across the board
void addEnemy(uint16_t x_pos, uint16_t x_vel,uint16_t y_vel, uint16_t health); //--MAIN CARES!!!
void removeEnemy(struct Enemy * removePTR); 
void clearEnemies(); //------------------------------------------------------------MAIN CARES!!!
void freezeEnemies();//------------------------------------------------------------MAIN CARES!!!
uint16_t getBulletPos(struct Enemy * enemy,uint8_t XOrY);//------------------------------------------------------------MAIN CARES!!!

//Specific to 1 Enemy
void enemyMovement(struct Enemy * enemy);
void enemyMovement_ALL();//mf
void updateEnemyTimers(struct Enemy * enemy);
void updateEnemyTimers_ALL();//mf
void removeEnemyIfOOB(struct Enemy * enemy);
void removeEnemyIfOOB_ALL(); //mf
uint8_t dealDamage(struct Enemy * enemy, uint8_t damage);//------------------------MAIN CARES!!!

//Call functions noramlly called in the loop without parameters.
void callMultiFuncEnemy();//------------------------------------------------------------MAIN CARES!!!

#endif