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/Collectibles/Health/Health.cpp
- Revision:
- 57:1c12361b6e3d
- Parent:
- 56:ef9521b7ed78
diff -r ef9521b7ed78 -r 1c12361b6e3d Entity/Collectibles/Health/Health.cpp
--- a/Entity/Collectibles/Health/Health.cpp Thu May 09 08:42:52 2019 +0000
+++ b/Entity/Collectibles/Health/Health.cpp Thu May 09 09:50:19 2019 +0000
@@ -2,19 +2,19 @@
Health::Health(float pos_x, float pos_y)
{
- hp = 1;
- attack = -1;
+ _hp = 1;
+ _attack = -1;
- hitbox.width = 7;
- hitbox.height = 7;
+ _hitbox.width = 7;
+ _hitbox.height = 7;
- position.x = pos_x;
- position.y = pos_y;
+ _position.x = pos_x;
+ _position.y = pos_y;
- sprite_size.width = 7;
- sprite_size.height = 7;
- sprite_size.offset_x = 0;
- sprite_size.offset_y = 0;
+ _sprite_size.width = 7;
+ _sprite_size.height = 7;
+ _sprite_size.offset_x = 0;
+ _sprite_size.offset_y = 0;
}
void Health::move(float unused, float unused1, char * unused2, bool * unused3) // Health doesnt move, only typed out since the virtual function is pure
@@ -24,14 +24,14 @@
void Health::draw(N5110 &lcd)
{
- lcd.drawSpriteTransparent(position.x+sprite_size.offset_x,
- position.y+sprite_size.offset_y,
- sprite_size.height,
- sprite_size.width,
+ lcd.drawSpriteTransparent(_position.x+_sprite_size.offset_x,
+ _position.y+_sprite_size.offset_y,
+ _sprite_size.height,
+ _sprite_size.width,
(char *) health_sprite);
}
void Health::take_damage(int damage)
{
- hp -= damage;
+ _hp -= damage;
}
\ No newline at end of file