![](/media/cache/profiles/fa1fc368935a59b748bec5e15aca97ea.jpg.50x50_q85.png)
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:
- 0:c9afe145b57b
- Child:
- 1:527a11035e0b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bullet.h Sun Sep 17 17:05:27 2017 +0000 @@ -0,0 +1,39 @@ +#ifndef __BULLET_UNIT +#define __BULLET_UNIT +#include "Constants.h" +#include <stdint.h> + +struct Bullet +{ + 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; +}; + +static struct Bullet * enemyBulletPTR; +static struct Bullet * playerBulletPTR; +static uint16_t enemyBulletCount; +static uint16_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!!! +void removeBullet(struct Bullet * bullet); +void clearBullets();//-----------------------------------------------------------------------------------MAIN CARES!!! + +//Specific to 1 Bullet +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