From fadf1b6888129b1b1393c3266a8399a2a77079f9 Mon Sep 17 00:00:00 2001 From: Milang Date: Mon, 13 Jan 2020 20:24:06 +0100 Subject: [PATCH] remove auto deletion of ennemies when they pass to the left of the screen (was firstly introduced when you couldn't go back but now it is useless and makes the game too easy) --- src/ennemi.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/ennemi.c b/src/ennemi.c index 73831c5..ff07ac7 100644 --- a/src/ennemi.c +++ b/src/ennemi.c @@ -74,10 +74,10 @@ void hurt_mario() void move_ennemi(ennemi_t *e) { - if (e->b.x-e->b.w>world_get_real_x0() && e->b.xb.xdiscovered=1; - if (e->b.x+e->b.w<=world_get_real_x0()) - e->type=NONE; + //if (e->b.x+e->b.w<=world_get_real_x0()) + // e->type=NONE; if (e->discovered==0) return; if (e->life==DEAD) @@ -97,6 +97,7 @@ void move_ennemi(ennemi_t *e) for (int i=0; idiscovered && t->type!=NONE) { @@ -145,6 +146,8 @@ void move_ennemi(ennemi_t *e) } } + const bool mario_fatal_hit = (mario.p.last_vy<=-2 || mario.p.vy<=-2); + if (e->type==GOOMBA_ID) { box_move(&e->b); @@ -166,7 +169,7 @@ void move_ennemi(ennemi_t *e) e->type=NONE; if (e_hit_mario) { - if (mario.p.last_vy<=-2) + if (mario_fatal_hit) { e->life=DEAD; e->p1=0; @@ -200,7 +203,7 @@ void move_ennemi(ennemi_t *e) e->type=NONE; if (e_hit_mario) { - if (mario.p.last_vy<=-2) + if (mario_fatal_hit) { e->type=CARAPACE_VERTE; e->b.h=CARAPACE_Y; @@ -250,7 +253,7 @@ void move_ennemi(ennemi_t *e) if (mario.p.x<=e->b.x) e->p1=1; e->b.vx=6*e->p1; - if (mario.p.last_vy<=-2) + if (mario_fatal_hit) { mario.p.vy=4; mario.p.y=e->b.y+CARAPACE_Y; @@ -265,7 +268,7 @@ void move_ennemi(ennemi_t *e) } else { - if (mario.p.last_vy<=-2) + if (mario_fatal_hit) { e->p1=0; e->b.vx=0;