diff --git a/INIT/CasioRAM.mem b/INIT/CasioRAM.mem index 4eae054..d87041b 100644 Binary files a/INIT/CasioRAM.mem and b/INIT/CasioRAM.mem differ diff --git a/SuperCbr.g1a b/SuperCbr.g1a index 319149b..5c072fc 100644 Binary files a/SuperCbr.g1a and b/SuperCbr.g1a differ diff --git a/assets-fx/img/plante.png b/assets-fx/img/plante.png index 9d76edb..e33ad28 100644 Binary files a/assets-fx/img/plante.png and b/assets-fx/img/plante.png differ diff --git a/include/ennemi.h b/include/ennemi.h index 6799c47..9a1a6ba 100644 --- a/include/ennemi.h +++ b/include/ennemi.h @@ -26,7 +26,9 @@ extern const int ennemi_heights[NOMBRE_ENNEMIS]; #define PLANTE(x,y) {PLANTE_ID,{x,y,ennemi_widths[PLANTE_ID],ennemi_heights[PLANTE_ID],0,0,0,0},ALIVE,0,0} // pour plante ID, ymin est associé à p1=0 -// Dimensions pr les boites + + +#define PLANTE_NLAPS 99 typedef struct @@ -48,4 +50,6 @@ void ennemiMove(ennemi_t * e); void ennemiesInit(ennemi_t * table, int s); +void plante_tour(ennemi_t *e); + #endif diff --git a/src/ennemi.c b/src/ennemi.c index d45ae05..d068720 100644 --- a/src/ennemi.c +++ b/src/ennemi.c @@ -72,6 +72,7 @@ void ennemiDisplay(ennemi_t const * e) { extern image_t img_plante; t.sheet=&img_plante; + t.width*=2; dsx=-4; } } @@ -79,22 +80,22 @@ void ennemiDisplay(ennemi_t const * e) } } -static void plante_tour(ennemi_t *e) +void plante_tour(ennemi_t *e) { if (e->type==PLANTE_ID) { e->p1++; - e->p1%=93; + e->p1%=PLANTE_NLAPS; if (0<=e->p1 && e->p1<35) // (plante en bas, en attente) { if (abs(mario.p.x-e->b.x)<15) e->p1=0; } - if (35<=e->p1 && e->p1<52) + if (35<=e->p1 && e->p1<58) { if ((e->p1+1)%3==0) e->b.y++; } - if (52<=e->p1 && e->p1<75){} // plante en attente en haut - if (75<=e->p1 && e->p1<92) + if (58<=e->p1 && e->p1<75){} // plante en attente en haut + if (75<=e->p1 && e->p1<98) { if (e->p1%3==0) e->b.y--; } @@ -267,7 +268,7 @@ void ennemiMove(ennemi_t *e) e->p1=2; e->b.vx=0; scoreAdd(KILL_ENNEMI); - mario.p.vy=4; + mario.p.vy=6; mario.p.y=e->b.y+ennemi_heights[e->type]+1; break; @@ -279,19 +280,21 @@ void ennemiMove(ennemi_t *e) if (mario.p.x<=e->b.x) e->p1=1; e->b.vx=6*e->p1; - mario.p.vy=4; + mario.p.vy=6; mario.p.y=e->b.y+ennemi_heights[CARAPACE_VERTE]; - boxMove(&e->b); - } else { - e->p1=e->b.vx=0; - mario.p.vy=4; + e->p1=e->b.vx=mario.p.vx=0; + mario.p.vy=6; mario.p.y=e->b.y+ennemi_heights[CARAPACE_VERTE]+1; } break; + case PLANTE_ID: + hurtMario(); + break; + } else if (e_hitMario) switch (e->type) // hurt mario { @@ -310,17 +313,22 @@ void ennemiMove(ennemi_t *e) e->b.vx=6*e->p1; if (mario_fatal_hit) { - mario.p.vy=4; + mario.p.vy=6; mario.p.y=e->b.y+ennemi_heights[CARAPACE_VERTE]; } else { // mario bounce if (mario.p.x>=e->b.x) mario.p.x=e->b.x+e->b.w; else mario.p.x=e->b.x-mario.p.w; + mario.p.vx=0; } } else hurtMario(); break; + + case PLANTE_ID: + hurtMario(); + break; } } diff --git a/src/level.c b/src/level.c index 556da02..bbcdb01 100644 --- a/src/level.c +++ b/src/level.c @@ -321,7 +321,7 @@ static void unpackLevel(packed_level_t * p) } else if (contents==PACKED_PLANTE) { - ennemi_t e=PLANTE(8*x+4,8*y/*-8*/); + ennemi_t e=PLANTE(8*x+4,8*y-8); ennemis[nombre_ennemis]=e; nombre_ennemis++; } diff --git a/src/tile.c b/src/tile.c index 28d66b2..5fce5cf 100755 --- a/src/tile.c +++ b/src/tile.c @@ -46,7 +46,7 @@ extern image_t img_star; const tileset_t mario_starman={&img_star, TILE_W, TILE_H, 0}; extern image_t img_fleur; -const tileset_t fleur={&img_fleur, TILE_W, TILE_H, 0}; +const tileset_t fleur={&img_fleur, 2*TILE_W, TILE_H, 0}; extern image_t img_bullet; const tileset_t bullet={&img_bullet, TILE_W/2, TILE_H/2, 1}; diff --git a/src/tuyau.c b/src/tuyau.c index b1efb82..aa6ba7f 100644 --- a/src/tuyau.c +++ b/src/tuyau.c @@ -55,6 +55,8 @@ void teleportersActive() mario.p.x=t.tx*8+4; mario.p.y=t.ty*8; // Move Mario mario.p.vx=0; mario.p.vy=0; // Disables every move of mario cameraAdjust(); + + for (i=0; i