X-Git-Url: https://git.rohieb.name/hackover2013-badge-firmware.git/blobdiff_plain/926f4cca0bec5b39f4d45dc9cdece5ddcedbcd95..21faf6a1e98788aa0fbf73d97b6d59101fbe400d:/badge/jumpnrun/enemies.c?ds=sidebyside diff --git a/badge/jumpnrun/enemies.c b/badge/jumpnrun/enemies.c index 7e2e6f6..b518b51 100644 --- a/badge/jumpnrun/enemies.c +++ b/badge/jumpnrun/enemies.c @@ -118,10 +118,8 @@ void jumpnrun_process_enemy(jumpnrun_enemy *self, state->left + BADGE_DISPLAY_WIDTH + spawn_margin < fixed_point_cast_int(self->spawn_pos.x)) { self->flags &= ~JUMPNRUN_ENEMY_UNAVAILABLE; } - } else if((fixed_point_gt(self->spawn_pos.x, FIXED_POINT(state->left - spawn_margin, 0)) && - fixed_point_lt(self->spawn_pos.x, FIXED_POINT(state->left - spawn_margin / 2, 0))) || - (fixed_point_lt(self->spawn_pos.x, FIXED_POINT(state->left + BADGE_DISPLAY_WIDTH + spawn_margin, 0)) && - fixed_point_gt(self->spawn_pos.x, FIXED_POINT(state->left + BADGE_DISPLAY_WIDTH, 0)))) { + } else if(fixed_point_gt(self->spawn_pos.x, FIXED_POINT(state->left - spawn_margin, 0)) && + fixed_point_lt(self->spawn_pos.x, FIXED_POINT(state->left + BADGE_DISPLAY_WIDTH + spawn_margin, 0))) { // enemy unspawned, available and in spawn zone. self->flags = JUMPNRUN_ENEMY_SPAWNED | JUMPNRUN_ENEMY_UNAVAILABLE; self->base.current_box = rectangle_new(self->spawn_pos, self->type->extent);