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)
This commit is contained in:
Milang 2020-01-13 20:24:06 +01:00
parent 0be8eef60a
commit fadf1b6888
1 changed files with 10 additions and 7 deletions

View File

@ -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.x<world_get_real_x0()+128)
if (e->b.x<world_get_real_x0()+64)
e->discovered=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; i<ennemis_global_size; i++)
{
ennemi_t* t=&ennemis_global[i];
if (t!=e && t->discovered && 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;