diff options
Diffstat (limited to 'enemy.c')
-rw-r--r-- | enemy.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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--; |