diff options
author | quou <quou@disroot.org> | 2023-05-07 12:53:46 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2023-05-07 12:54:06 +1000 |
commit | 5f341eacdf0d75a4b334969a2d8a4701d61e4d9e (patch) | |
tree | ee3a4c44b92e975530e1e6fed18c8852a6f70a93 /enemy.c | |
parent | 5ef6a71e935e2c3d1e5f9828e8cdbd78403a06a0 (diff) |
Add waves and stuff.
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--; |