Fixed camera

master
Milang 3 years ago
parent 23b98fd3d4
commit 35c1214270
  1. 4
      src/camera.c

@ -18,8 +18,8 @@ void cameraMove() // only vertical movement
{
static int camera_vy=0;
if (MKB_getKeyState(MK_UP) && abs(delta_y)<24) { camera_vy=0; delta_y-=4;}
if (MKB_getKeyState(MK_DOWN) && abs(delta_y)<24) { camera_vy=0; delta_y+=4;}
if (MKB_getKeyState(MK_UP) && (abs(delta_y)<20 || delta_y>=0)) { delta_y-=4;}
if (MKB_getKeyState(MK_DOWN) && (abs(delta_y)<20 || delta_y<=0)) { delta_y+=4;}
if (!MKB_getKeyState(MK_DOWN) && !MKB_getKeyState(MK_UP)) delta_y-=4*sgn(delta_y);
if (mario.p.y==last_vy) immobile++;

Loading…
Cancel
Save