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/Health/Health.cpp
- Revision:
- 28:98848e6a77a2
- Child:
- 29:6b8411bb040a
diff -r a1b41626f57c -r 98848e6a77a2 Entity/Health/Health.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Entity/Health/Health.cpp Thu May 02 21:30:49 2019 +0000
@@ -0,0 +1,34 @@
+#include "Health.h"
+
+Health::Health(float pos_x, float pos_y)
+{
+ _damage_self_upon_collision = true;
+ _hp_drop_chance = 0; // out of 10
+ moving = true;
+ face = 0;
+ hp = 1;
+ attack = -1;
+ hitbox.width = 7;
+ hitbox.height = 7;
+ 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;
+}
+
+void Health::move(float unused, float unused1, int * unused2)
+{
+
+}
+
+int * Health::get_frame()
+{
+ return (int *) health_sprite;
+}
+
+void Health::take_damage(int damage)
+{
+ hp -= damage;
+}
\ No newline at end of file