diff --git a/INIT/CasioRAM.mem b/INIT/CasioRAM.mem index e1d5594..2281524 100644 Binary files a/INIT/CasioRAM.mem and b/INIT/CasioRAM.mem differ diff --git a/SuperCbr.dlw b/SuperCbr.dlw index 6157e84..7d77d80 100644 --- a/SuperCbr.dlw +++ b/SuperCbr.dlw @@ -2,7 +2,7 @@ [_1] Type=5 -Order=1 +Order=0 Top=15 Left=2235 Height=4740 @@ -13,7 +13,7 @@ OptionA=0 [_2] Type=1 -Order=0 +Order=1 Top=15 Left=7800 Height=4740 diff --git a/SuperCbr.g1a b/SuperCbr.g1a index 4fa9e3b..78c98ec 100644 Binary files a/SuperCbr.g1a and b/SuperCbr.g1a differ diff --git a/include/mario.h b/include/mario.h index 6a7e2d2..aeec2aa 100755 --- a/include/mario.h +++ b/include/mario.h @@ -33,7 +33,7 @@ void mario_draw(); void mario_jump(); void mario_move(); - +void ResetMarioJump(); void mario_bigger(); void mario_smaller(); @@ -49,4 +49,4 @@ extern int last_vx_sign; extern int mario_star_mode; -#endif \ No newline at end of file +#endif diff --git a/src/mario.c b/src/mario.c index f0cc121..cb33c60 100755 --- a/src/mario.c +++ b/src/mario.c @@ -91,7 +91,14 @@ int test_sol_le_plus_proche(int x, int y) return distance; } +static int jump_buffering=0; +static int coyote_time=5; +void ResetMarioJump() +{ + jump_buffering=0; + coyote_time=5; +} int global_quit=0; void mario_move() @@ -112,8 +119,7 @@ void mario_move() id_frame++; if (mario_has_bullets==1 && mkb_getstate(MK_RUN)==2) bullet_throw(); - static int jump_buffering=0; - static int coyote_time=0; + if (mkb_getstate(MK_JUMP)==2 || jump_buffering) //|| keys[MK_JUMP2]==2) { diff --git a/src/tuyau.c b/src/tuyau.c index 3f0aa50..ceb0d95 100644 --- a/src/tuyau.c +++ b/src/tuyau.c @@ -66,10 +66,10 @@ void teleport_active() } } - + ResetMarioJump(); mario.p.x=t.tx*8+4; mario.p.y=t.ty*8; mario.p.vx=0; mario.p.vy=0; camera_adjust(); } } -} \ No newline at end of file +} diff --git a/src/world.c b/src/world.c index fd95f35..3024f6f 100755 --- a/src/world.c +++ b/src/world.c @@ -31,7 +31,7 @@ cell_t* world_get(int x, int y) x/=8; y/=8; if (0<=x && xw && 0<=y && yh) - return &map_current->data[x*map_current->h+y]; + return &map_current->data[x*map_current->h+y]; else { return &death; @@ -42,7 +42,7 @@ void display_cell(int cx, int cy, int sx, int sy, int plan) { const cell_t * cell=world_get(cx,cy); if (cell==0) - return; + return; if (plan==1) { if (cell->type==TUYAU) @@ -81,18 +81,18 @@ void display_cell(int cx, int cy, int sx, int sy, int plan) i->time_hit_id++; sy+=2+(i->time_hit_id-4)/4; if (i->time_hit_id==8) - i->time_hit_id=0; + i->time_hit_id=0; if (i->state==1 && i->time_hit_id==0) - i->type=0; + i->type=0; } if (i->hidden==0) { if (i->time_hit_id || i->content==0 || i->number>0) - draw_tile(sx, sy, &brick, 0, i->state); + draw_tile(sx, sy, &brick, 0, i->state); else - draw_tile(sx, sy, &gift, 1, 0); + draw_tile(sx, sy, &gift, 1, 0); if (i->content==1 && i->time_hit_id && i->time_hit_id<=4) - draw_tile(sx, sy+8, &coin, 0, 0); + draw_tile(sx, sy+8, &coin, 0, 0); } } @@ -104,16 +104,16 @@ void display_cell(int cx, int cy, int sx, int sy, int plan) i->time_hit_id++; sy+=2+(i->time_hit_id-4)/4; if (i->time_hit_id==8) - i->time_hit_id=0; + i->time_hit_id=0; } if (i->hidden==0) { if (i->time_hit_id || i->number) - draw_tile(sx, sy, &gift, 0, 0); + draw_tile(sx, sy, &gift, 0, 0); else - draw_tile(sx, sy, &gift, 1, 0); + draw_tile(sx, sy, &gift, 1, 0); if (i->content==1 && i->time_hit_id && i->time_hit_id<=4) - draw_tile(sx, sy+8, &coin, 0, 0); + draw_tile(sx, sy+8, &coin, 0, 0); } } } @@ -129,15 +129,15 @@ void display_cell(int cx, int cy, int sx, int sy, int plan) { deco_t* i=(deco_t*)cell; if (i->type==BUISSON) - draw_tile(sx, sy, &buisson, i->x, i->y); + draw_tile(sx, sy, &buisson, i->x, i->y); if (i->type==NUAGE) - draw_tile(sx, sy, &nuage, i->x, i->y); + draw_tile(sx, sy, &nuage, i->x, i->y); if (i->type==COLLINE) - draw_tile(sx, sy, &colline, i->x, i->y); + draw_tile(sx, sy, &colline, i->x, i->y); if (i->type==CASTLE) - draw_tile(sx, sy, &castle, i->x, i->y); + draw_tile(sx, sy, &castle, i->x, i->y); if (i->type==END_LEVEL) - draw_tile(sx-8, sy, &end_level, 0, i->y); + draw_tile(sx-8, sy, &end_level, 0, i->y); } } } @@ -150,12 +150,12 @@ int world_get_ctg(int x, int y) return CTG_DEATH; } if (plateforme_check_collide(x,y)) - return CTG_SOIL; + return CTG_SOIL; if (c->type==ARBRE) { arbre_t* a=(arbre_t*)c; if (a->x==1&&a->y==1) - return CTG_EMPTY; + return CTG_EMPTY; } switch (c->type) { @@ -213,10 +213,12 @@ void world_draw() } //teleporteurs_display(); //dvline(teleporteurs[0].x-world_get_real_x0(),C_BLACK); - + /* if (mkb_getstate(MK_JUMP)) drect(1,60,6,63,C_BLACK); if (mkb_getstate(MK_RUN)) drect(8,60,13,63,C_BLACK); - + */ + // draw immunity remaining time + if (mario_immunity) drect(0,4+mario_immunity,2,64, C_BLACK); } void world_move() @@ -248,13 +250,13 @@ void world_set(int w, int h, int x, int y, cell_t const * a) // If the new map size is null => invalid map, return if (0==w*h) - return; + return; // Calculates the new struct size int size= 4*sizeof(int) + sizeof(cell_t)*w*h; map_current=(map_t*)malloc_prof(size); if (map_current==0) - malloc_error(); + malloc_error(); // Copy the map to ram map_current->w = w;