diff --git a/SuperCbr.g1a b/SuperCbr.g1a index 78c98ec..eb55acc 100644 Binary files a/SuperCbr.g1a and b/SuperCbr.g1a differ diff --git a/src/keyboard.c b/src/keyboard.c index e965f5b..4854e3b 100755 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -12,8 +12,7 @@ static mkb_t keys[6]={0}; int mkb_getstate(mkb_t const k) { - if (k!=MK_NONE) - return keys[k]; + if (k!=MK_NONE) return keys[k]; return 0; } diff --git a/src/mario.c b/src/mario.c index cb33c60..ccdfeb2 100755 --- a/src/mario.c +++ b/src/mario.c @@ -235,7 +235,6 @@ void mario_move() { c->number--; score_add_coin(); - score_add(200); } else if (c->content==2 && c->number) { diff --git a/src/score.c b/src/score.c index 2e7d58c..a2564a8 100644 --- a/src/score.c +++ b/src/score.c @@ -64,6 +64,7 @@ void score_add_coin() { pieces++; time_last_piece=time_id; + score_add(200); } void score_add(int i) diff --git a/src/tuyau.c b/src/tuyau.c index ceb0d95..b26268f 100644 --- a/src/tuyau.c +++ b/src/tuyau.c @@ -15,9 +15,9 @@ void set_teleporteurs(teleport_t const * const t, int const n) if (t) { if (n>6) - nombre_teleporteurs=6; + nombre_teleporteurs=6; else - nombre_teleporteurs=n; + nombre_teleporteurs=n; if (nombre_teleporteurs) { memcpy(teleporteurs, t, sizeof(teleport_t)*n); @@ -33,11 +33,7 @@ void teleport_active() teleport_t const t = teleporteurs[i]; if ((t.x==mario.p.x/8) && (t.y*8==mario.p.y || t.y*8==mario.p.y+mario.p.h)) { - if (t.key>=0) - { - if (!mkb_getstate(t.key)) - continue; - } + if (!mkb_getstate(t.key)) continue; // Animation section if (t.key==MK_DOWN) @@ -66,9 +62,22 @@ void teleport_active() } } + if (t.key==MK_LEFT) + { + while (mario.p.x+mario.p.w>=8*t.x) + { + dclear(C_WHITE); + world_draw(0,0); + dupdate(); + wait_next_frame(); // 10 fps + wait_next_frame(); + mario.p.x--; + } + } + ResetMarioJump(); - mario.p.x=t.tx*8+4; mario.p.y=t.ty*8; - mario.p.vx=0; mario.p.vy=0; + 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 camera_adjust(); } }