diff --git a/INIT/CasioRAM.mem b/INIT/CasioRAM.mem index 6a3c43d..99c3c2f 100644 Binary files a/INIT/CasioRAM.mem and b/INIT/CasioRAM.mem differ diff --git a/SuperCbr.dlw b/SuperCbr.dlw index 7cfedc6..e525514 100644 --- a/SuperCbr.dlw +++ b/SuperCbr.dlw @@ -13,7 +13,7 @@ OptionA=0 [_2] Type=1 -Order=2 +Order=1 Top=15 Left=7800 Height=6885 @@ -25,7 +25,7 @@ OptionB=15 [_3] Type=6 -Order=1 +Order=2 Top=4035 Left=2715 Height=6390 diff --git a/SuperCbr.g1a b/SuperCbr.g1a index 135b7d2..9a69cf6 100644 Binary files a/SuperCbr.g1a and b/SuperCbr.g1a differ diff --git a/src/camera.c b/src/camera.c index e52c352..2f67669 100644 --- a/src/camera.c +++ b/src/camera.c @@ -3,37 +3,26 @@ #include #include #include +#include static int y=0; +static int last_vy=0; +static int immobile=0; +static int distance=0; +static int delta_y=0; // the player can choose the y positionning of the camera with arrows int cameraX() {return min(max(mario.p.x-40,0),map_current->w*8-128);} -int cameraY() {return max(y-32,0);} +int cameraY() {return max(max(y-32,0)-delta_y,0);} -static int immobile=0; -static int last_vy=0; - -static int distance=0; - -void cameraMove() // movement vertical seulement +void cameraMove() // only vertical movement { -/* static int isMoving=0; - static int ref_y=0; - if (mario.p.y-cameraY()<16 || mario.p.y-cameraY()>56) - { - isMoving=1; - ref_y=mario.p.y; - } - if (isMoving) - { - for (int i=0; i<9; i++) - y+=sgn(mario.p.y-y); - if (y==ref_y) - isMoving=0; - } -*/ + if (MKB_getKeyState(MK_UP) && abs(delta_y)<24) delta_y-=4; + if (MKB_getKeyState(MK_DOWN) && abs(delta_y)<24) delta_y+=4; + if (!MKB_getKeyState(MK_DOWN) && !MKB_getKeyState(MK_UP)) delta_y-=4*sgn(delta_y); + static int camera_vy=0; if (mario.p.y==last_vy) // mario arrêté - immobile++; + immobile++; else { last_vy=mario.p.y; @@ -54,13 +43,13 @@ void cameraMove() // movement vertical seulement //décéleration après avoir parvouru la moitié de la distance, sinon acceleration if (camera_vy*(camera_vy+1)>distance) - camera_vy--; + camera_vy--; else - camera_vy++; + camera_vy++; //y++; if (camera_vy<0) - camera_vy=0; + camera_vy=0; if (((y+camera_vy*sgn(mario.p.y-y)/2)-(mario.p.y))*sgn(mario.p.y-y)>0) { @@ -68,7 +57,7 @@ void cameraMove() // movement vertical seulement camera_vy=0; } else - y+=(camera_vy*sgn(mario.p.y-y))/2; + y+=(camera_vy*sgn(mario.p.y-y))/2; } last_vy=mario.p.y; diff --git a/src/score.c b/src/score.c index 762f80f..c140142 100644 --- a/src/score.c +++ b/src/score.c @@ -107,8 +107,7 @@ void scoreDisplay() sprintf(str, "c*%d", pieces); dtext(50,0,str, C_BLACK, C_WHITE); } - - time_id++; + if (time_id%8==0) { time_left--;