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: Player.h
- Revision:
- 1:527a11035e0b
- Parent:
- 0:c9afe145b57b
--- a/Player.h Sun Sep 17 17:05:27 2017 +0000 +++ b/Player.h Fri Nov 17 02:23:33 2017 +0000 @@ -4,18 +4,30 @@ #include "stdint.h" struct Player { - uint16_t x_pos; - uint16_t y_pos; - uint16_t health; - uint16_t rapidFireTimer; - uint16_t powerShotTimer; - uint16_t wideShotTimer; - uint16_t shieldTimer; - uint16_t gunTimer; + int16_t x_pos; + int16_t y_pos; + int16_t health; + int16_t rapidFireTimer; + int16_t RFT_Timer; + int16_t powerShotTimer; + int16_t wideShotTimer; + int16_t shieldTimer; + int16_t gunTimer; }; -static struct Player player; +extern struct Player player; -void movePlayer(uint8_t x_vel, uint8_t y_vel); +//User interface functions. +void resetPlayer(); +int16_t getPlayerBulletPos(int8_t XorY); +int8_t dealDamageToPlayer(); +//int8_t callMultiFuncPlayer(int8_t x_dir, int8_t y_dir, int8_t didUserRequestFire); +void callMultiFuncPlayer(); +void movePlayer(int8_t x_dir, int8_t y_dir); +int8_t shouldFire(int8_t didUserRequestFire); + +//Functions user does not need to worry about. + void updatePlayerTimers(); + #endif \ No newline at end of file