aboutsummaryrefslogtreecommitdiff
path: root/enemy.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2023-05-07 12:53:46 +1000
committerquou <quou@disroot.org>2023-05-07 12:54:06 +1000
commit5f341eacdf0d75a4b334969a2d8a4701d61e4d9e (patch)
treeee3a4c44b92e975530e1e6fed18c8852a6f70a93 /enemy.c
parent5ef6a71e935e2c3d1e5f9828e8cdbd78403a06a0 (diff)
Add waves and stuff.
Diffstat (limited to 'enemy.c')
-rw-r--r--enemy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/enemy.c b/enemy.c
index 04baec4..60366fb 100644
--- a/enemy.c
+++ b/enemy.c
@@ -105,6 +105,7 @@ void enemy_system(World* world) {
enemy = &world->enemies[i];
if (enemy->hp <= 0) {
destroy_entity(world, i);
+ world->enemies_killed++;
if ((bits & ctype_position) && (bits & ctype_skull)) {
pos = &world->positions[i];
@@ -130,7 +131,7 @@ void enemy_system(World* world) {
dpy = ((ppos->y - pos->y) >> 4) + 256;
tpx = dpx;
tpy = dpy;
- d = ((dpx * dpx) >> fbits) + ((dpy * dpy) >> fbits);
+ d = ((dpx * dpx) + (dpy * dpy)) >> fbits;
if (enemy->being_damaged) {
enemy->being_damaged--;