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/Headless/Headless.cpp
- Revision:
- 23:5a8f75e93508
- Parent:
- 22:7abf4581bc9b
- Child:
- 27:a1b41626f57c
--- a/Entity/Headless/Headless.cpp Thu Apr 25 05:53:30 2019 +0000
+++ b/Entity/Headless/Headless.cpp Thu Apr 25 23:15:44 2019 +0000
@@ -7,6 +7,7 @@
moving = true;
face = 0;
hp = 4;
+ attack = 1;
hitbox.width = 6;
hitbox.height = 5;
position.x = pos_x;
@@ -18,7 +19,7 @@
frame.count = 0;
frame.number = 0;
frame.max = 4;
- velocity = 0.5;
+ velocity = 0.25;
}
void Headless::move(float player_x, float player_y)
@@ -45,7 +46,12 @@
} else {
frame.count = 0;
}
- frame.number = (frame.count/5) % frame.max;
+ frame.number = (frame.count/16) % frame.max;
+}
+
+void Headless::take_damage(int damage)
+{
+ hp -= damage;
}
int * Headless::get_frame()