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
Diff: Bullet.h
- Revision:
- 1:527a11035e0b
- Parent:
- 0:c9afe145b57b
diff -r c9afe145b57b -r 527a11035e0b Bullet.h --- a/Bullet.h Sun Sep 17 17:05:27 2017 +0000 +++ b/Bullet.h Fri Nov 17 02:23:33 2017 +0000 @@ -7,33 +7,30 @@ { struct Bullet * prev; struct Bullet * next; - uint16_t x_pos; - uint16_t y_pos; - uint16_t x_vel; - uint16_t y_vel; - uint8_t powerShot; - uint8_t isPlayerBullet; + int16_t x_pos; + int16_t y_pos; + int16_t x_vel; + int16_t y_vel; + int8_t powerShot; + int8_t isPlayerBullet; + int8_t isBombBullet; }; -static struct Bullet * enemyBulletPTR; -static struct Bullet * playerBulletPTR; -static uint16_t enemyBulletCount; -static uint16_t playerBulletCount; - +extern struct Bullet * enemyBulletPTR; +extern struct Bullet * playerBulletPTR; +extern int16_t enemyBulletCount; +extern int16_t playerBulletCount; -//Across the board -void addEnemyBullet(uint16_t x_pos, uint16_t y_pos);//---------------------------------------------------MAIN CARES!!! -void addPlayerBullet(uint16_t x_pos, uint16_t y_pos, uint16_t x_vel, uint16_t y_vel, uint8_t power); //--MAIN CARES!!! +//User interface functions. +void addEnemyBullet(int16_t x_pos, int16_t y_pos); +void addPlayerBullet(int16_t x_pos, int16_t y_pos, int16_t x_vel, int16_t y_vel, int8_t power, int8_t bomb); +void clearBullets(); +void callMultiFuncBullet(); void removeBullet(struct Bullet * bullet); -void clearBullets();//-----------------------------------------------------------------------------------MAIN CARES!!! -//Specific to 1 Bullet +//Functions user does not need to worry about. void bulletMovement(struct Bullet * bullet); void bulletMovement_ALL(); void removeBulletIfOOB(struct Bullet * bullet); void removeBulletIfOOB_ALL(); - -//Call functions noramlly called in the loop without parameters. -void callMultiFuncBullet();//------------------------------------------------------------MAIN CARES!!! - #endif \ No newline at end of file