From 5f341eacdf0d75a4b334969a2d8a4701d61e4d9e Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 7 May 2023 12:53:46 +1000 Subject: Add waves and stuff. --- enemy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'enemy.c') 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--; -- cgit v1.2.3-54-g00ecf