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
Game.h@1:527a11035e0b, 2017-11-17 (annotated)
- Committer:
- Oshyrath
- Date:
- Fri Nov 17 02:23:33 2017 +0000
- Revision:
- 1:527a11035e0b
First Publish of the code.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Oshyrath | 1:527a11035e0b | 1 | #ifndef __GAME |
Oshyrath | 1:527a11035e0b | 2 | #define __GAME |
Oshyrath | 1:527a11035e0b | 3 | #include "Enemy.h" |
Oshyrath | 1:527a11035e0b | 4 | #include "Bullet.h" |
Oshyrath | 1:527a11035e0b | 5 | #include "Player.h" |
Oshyrath | 1:527a11035e0b | 6 | #include "PowerUp.h" |
Oshyrath | 1:527a11035e0b | 7 | #include "RandomVar.h" |
Oshyrath | 1:527a11035e0b | 8 | #include <math.h> |
Oshyrath | 1:527a11035e0b | 9 | extern int16_t level; |
Oshyrath | 1:527a11035e0b | 10 | extern int16_t levelScore; |
Oshyrath | 1:527a11035e0b | 11 | extern int16_t totalScore; |
Oshyrath | 1:527a11035e0b | 12 | extern int16_t lives; |
Oshyrath | 1:527a11035e0b | 13 | extern int8_t X_DIR; |
Oshyrath | 1:527a11035e0b | 14 | extern int8_t Y_DIR; |
Oshyrath | 1:527a11035e0b | 15 | extern int8_t didUserRequestFire; |
Oshyrath | 1:527a11035e0b | 16 | |
Oshyrath | 1:527a11035e0b | 17 | void newGame(); |
Oshyrath | 1:527a11035e0b | 18 | void newLevel(); |
Oshyrath | 1:527a11035e0b | 19 | int8_t shouldAddEnemy(); |
Oshyrath | 1:527a11035e0b | 20 | void addRandomEnemy(); |
Oshyrath | 1:527a11035e0b | 21 | void addWideShotBullets(); |
Oshyrath | 1:527a11035e0b | 22 | void callMultiFunc(); |
Oshyrath | 1:527a11035e0b | 23 | int8_t didBulletHitEnemy(struct Enemy * enemy, struct Bullet * bullet); |
Oshyrath | 1:527a11035e0b | 24 | void checkIfBulletsHitEnemies(); |
Oshyrath | 1:527a11035e0b | 25 | void enemiesFireBullet(); |
Oshyrath | 1:527a11035e0b | 26 | void firePlayerBullet(); |
Oshyrath | 1:527a11035e0b | 27 | void usePowerUpAbility(); |
Oshyrath | 1:527a11035e0b | 28 | void generateExplosion(); |
Oshyrath | 1:527a11035e0b | 29 | int8_t didPlayerHitPowerUp(struct PowerUp * powerUp); |
Oshyrath | 1:527a11035e0b | 30 | int8_t didBulletHitPlayer(struct Bullet * bullet); |
Oshyrath | 1:527a11035e0b | 31 | int8_t didPlayerCollideWithEnemy(struct Enemy * enemy); |
Oshyrath | 1:527a11035e0b | 32 | void collideBulletsWithPlayer(); |
Oshyrath | 1:527a11035e0b | 33 | void collideWithEnemies(); |
Oshyrath | 1:527a11035e0b | 34 | void pickUpPowerUps(); |
Oshyrath | 1:527a11035e0b | 35 | void loopIteration(); |
Oshyrath | 1:527a11035e0b | 36 | char didLoseLife(); |
Oshyrath | 1:527a11035e0b | 37 | char isGameOver(); |
Oshyrath | 1:527a11035e0b | 38 | char didLevelUp(); |
Oshyrath | 1:527a11035e0b | 39 | #endif |