Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MotionSensor
Diff: Entity/Player/Player.cpp
- Revision:
- 33:4f3948dcd2f7
- Parent:
- 32:fe6359ef9916
- Child:
- 34:1d5b4da3935e
diff -r fe6359ef9916 -r 4f3948dcd2f7 Entity/Player/Player.cpp
--- a/Entity/Player/Player.cpp Mon May 06 08:56:48 2019 +0000
+++ b/Entity/Player/Player.cpp Mon May 06 13:27:26 2019 +0000
@@ -24,7 +24,8 @@
valid_bullets[i] = false;
}
fire_rate_counter = 0;
- invulnerability_counter = invulnerability_period;
+
+ invulnerability_counter = INVULNERABILITY_PERIOD;
// Upgradable status
fire_rate_delay = 30;
@@ -50,9 +51,9 @@
{
return 9;
}
-int * Player::get_hearts_sprite()
+char * Player::get_hearts_sprite()
{
- return (int *) sprite_heart;
+ return (char *) sprite_heart;
}
// Functions
@@ -113,7 +114,7 @@
if (damage < 0){
hp -= damage;
}
- else if (invulnerability_counter >= invulnerability_period) {
+ else if (invulnerability_counter >= INVULNERABILITY_PERIOD) {
hp -= damage;
invulnerability_counter = 0;
}
@@ -169,12 +170,12 @@
}
}
-int * Player::get_frame()
+char * Player::get_frame()
{
- if ((invulnerability_counter < invulnerability_period) && (invulnerability_counter % 10 <= 4)) {
- return (int*) sprite_transparent_player;
+ if ((invulnerability_counter < INVULNERABILITY_PERIOD) && (invulnerability_counter % 10 <= 4)) {
+ return (char*) sprite_transparent_player;
}
- return (int *) sprite_player[face][frame.number];
+ return (char *) sprite_player[face][frame.number];
}
void Player::buttons(bool button_A, bool button_B, bool button_Y, bool button_X)