![](/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
Bullet.h@0:c9afe145b57b, 2017-09-17 (annotated)
- Committer:
- Oshyrath
- Date:
- Sun Sep 17 17:05:27 2017 +0000
- Revision:
- 0:c9afe145b57b
- Child:
- 1:527a11035e0b
This is the first push for Starship game for STM32F429i-DISC1.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Oshyrath | 0:c9afe145b57b | 1 | #ifndef __BULLET_UNIT |
Oshyrath | 0:c9afe145b57b | 2 | #define __BULLET_UNIT |
Oshyrath | 0:c9afe145b57b | 3 | #include "Constants.h" |
Oshyrath | 0:c9afe145b57b | 4 | #include <stdint.h> |
Oshyrath | 0:c9afe145b57b | 5 | |
Oshyrath | 0:c9afe145b57b | 6 | struct Bullet |
Oshyrath | 0:c9afe145b57b | 7 | { |
Oshyrath | 0:c9afe145b57b | 8 | struct Bullet * prev; |
Oshyrath | 0:c9afe145b57b | 9 | struct Bullet * next; |
Oshyrath | 0:c9afe145b57b | 10 | uint16_t x_pos; |
Oshyrath | 0:c9afe145b57b | 11 | uint16_t y_pos; |
Oshyrath | 0:c9afe145b57b | 12 | uint16_t x_vel; |
Oshyrath | 0:c9afe145b57b | 13 | uint16_t y_vel; |
Oshyrath | 0:c9afe145b57b | 14 | uint8_t powerShot; |
Oshyrath | 0:c9afe145b57b | 15 | uint8_t isPlayerBullet; |
Oshyrath | 0:c9afe145b57b | 16 | }; |
Oshyrath | 0:c9afe145b57b | 17 | |
Oshyrath | 0:c9afe145b57b | 18 | static struct Bullet * enemyBulletPTR; |
Oshyrath | 0:c9afe145b57b | 19 | static struct Bullet * playerBulletPTR; |
Oshyrath | 0:c9afe145b57b | 20 | static uint16_t enemyBulletCount; |
Oshyrath | 0:c9afe145b57b | 21 | static uint16_t playerBulletCount; |
Oshyrath | 0:c9afe145b57b | 22 | |
Oshyrath | 0:c9afe145b57b | 23 | |
Oshyrath | 0:c9afe145b57b | 24 | //Across the board |
Oshyrath | 0:c9afe145b57b | 25 | void addEnemyBullet(uint16_t x_pos, uint16_t y_pos);//---------------------------------------------------MAIN CARES!!! |
Oshyrath | 0:c9afe145b57b | 26 | void addPlayerBullet(uint16_t x_pos, uint16_t y_pos, uint16_t x_vel, uint16_t y_vel, uint8_t power); //--MAIN CARES!!! |
Oshyrath | 0:c9afe145b57b | 27 | void removeBullet(struct Bullet * bullet); |
Oshyrath | 0:c9afe145b57b | 28 | void clearBullets();//-----------------------------------------------------------------------------------MAIN CARES!!! |
Oshyrath | 0:c9afe145b57b | 29 | |
Oshyrath | 0:c9afe145b57b | 30 | //Specific to 1 Bullet |
Oshyrath | 0:c9afe145b57b | 31 | void bulletMovement(struct Bullet * bullet); |
Oshyrath | 0:c9afe145b57b | 32 | void bulletMovement_ALL(); |
Oshyrath | 0:c9afe145b57b | 33 | void removeBulletIfOOB(struct Bullet * bullet); |
Oshyrath | 0:c9afe145b57b | 34 | void removeBulletIfOOB_ALL(); |
Oshyrath | 0:c9afe145b57b | 35 | |
Oshyrath | 0:c9afe145b57b | 36 | //Call functions noramlly called in the loop without parameters. |
Oshyrath | 0:c9afe145b57b | 37 | void callMultiFuncBullet();//------------------------------------------------------------MAIN CARES!!! |
Oshyrath | 0:c9afe145b57b | 38 | |
Oshyrath | 0:c9afe145b57b | 39 | #endif |