From 8595dc6562d9bd53391ab588cb9aee33e1f4ec27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 8 Sep 2018 11:11:27 +0200 Subject: [PATCH] Update map --- game.cpp | 58 +++++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/game.cpp b/game.cpp index b77923f..6dbdf26 100644 --- a/game.cpp +++ b/game.cpp @@ -68,11 +68,11 @@ const signed char levelFloor[] = 40,16,12, 8, 4, 0,48, 0, 0, 0, 0, 0,24, 2,24, 8,24, 0, 0, 9, 9, 0,28,32,48, 2, 2, 2,24, 40,20,48,48,48,48,48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 9, 0,24,32,40, 0, 0, 0,24, 40,24,48,40,40,40,40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,20,32,48, 0, 0, 0,24, - 40,28,32,32,32,32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8,16,32,40, 0, 0, 0,24, + 40,28,32,32,32,32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8,12,16,32,40, 0, 0, 0,24, 40,32,32,32,32,32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,32,32,32,32,32,48, 0, 0, 0,24, 40, 0,48,40,40,40,40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,-3,-8,-8,-5,-2, 0, 0, 0, 0,24, - 40, 0, 3,-8,-8,-8,32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,-3,-8,-8, 0, 0, 0, 0, 0, 0,24, - 40, 0, 6,-8,-8,-8,32, 0, 0, 0,48,48, 0,48,48, 0, 0,36,32,36,-8,-8, 0, 0, 0, 0, 0, 0,24, + 40, 0,-3,-8,-8,-8,32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,32,-3,-8,-8, 0, 0, 0, 0, 0, 0,24, + 40, 0,-6,-8,-8,-8,32, 0, 0, 0,48,48, 0,48,48, 0, 0,36,32,36,-8,-8, 0, 0, 0, 0, 0, 0,24, 40, 0,48,-8,-8,-8,32,32,32,32,40, 1, 0, 1,40,32,32,32,32,32,-8,-8, 0, 0, 0, 0, 0, 0,24, 40, 0,48,-8,-8,-8,-8,-8,-8,-8,-8, 0, 0, 0,-8,-8,-8,36,32,36,-8,-8, 0, 0, 0, 0, 0, 0,24, 40, 0,48,-8,-8,-8,-8,-8,-8,-8,-8, 0, 0, 0,-8,-8,-8,-8,-8,-8,-8,-8, 0, 0, 0, 0, 0, 0,24, @@ -95,19 +95,19 @@ const signed char levelCeiling[] = 40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, 40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, 40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,24,24,24,24, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,24,24,24,24, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, - 40,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, + 40,32,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, + 40,32,16,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, + 40,28,16,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, + 40,24,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, + 40,20,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99, + 40,18,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,24,24,24,24, + 40,18,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,24,24,24,24, + 40,18,16,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, + 40,18,16,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, 40,24,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, - 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, - 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, - 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,24,24,24,24 + 99,24,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, + 99,24,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,25,27,29,24, + 99,24,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,24,24,24,24,24,24 }; const unsigned char texture1[] = @@ -679,9 +679,9 @@ public: Character() { - mCamera.position.x = 7807;//UNITS_PER_SQUARE * 1; - mCamera.position.y = 18489;//UNITS_PER_SQUARE * 5; - mCamera.direction = -3550;//200; + mCamera.position.x = 23295;//UNITS_PER_SQUARE * 1; + mCamera.position.y = 14593;//UNITS_PER_SQUARE * 5; + mCamera.direction = -3350;//200; mCamera.height = UNITS_PER_SQUARE * 3; mCamera.resolution.x = 110 / SUBSAMPLE; mCamera.resolution.y = 88; @@ -835,7 +835,7 @@ int main() p.display.load565Palette(&pal[0]); // load a palette the same way as any other palette in any other screen mode p.display.persistence = 1; - p.setFrameRate(60); + p.setFrameRate(25); p.display.setFont(fontTiny); while (p.isRunning()) @@ -844,13 +844,12 @@ int main() { draw(); - int16_t step = max(1,UNITS_PER_SQUARE / 15); - const int16_t step2 = max(UNITS_PER_SQUARE / 40,1); + int16_t step = max(1,UNITS_PER_SQUARE / 7); + const int16_t step2 = max(UNITS_PER_SQUARE / 25,1); Vector2D d = angleToDirection(player.mCamera.direction); Vector2D moveOffset; - Unit heightOffset = player.mVericalSpeed; moveOffset.x = 0; moveOffset.y = 0; @@ -869,18 +868,14 @@ int main() if (p.upBtn()) { - if (strafe) - heightOffset = step; - else if (lookUpDown) + if (lookUpDown) player.mCamera.shear = min(player.mCamera.shear + 10,60); else moveOffset = d; } else if (p.downBtn()) { - if (strafe) - heightOffset = -step; - else if (lookUpDown) + if (lookUpDown) player.mCamera.shear = max(player.mCamera.shear - 10,-60); else { @@ -914,7 +909,7 @@ int main() Unit prevHeight = player.mCamera.height; - moveCameraWithCollision(&player.mCamera,moveOffset,heightOffset, + moveCameraWithCollision(&player.mCamera,moveOffset,player.mVericalSpeed, floorHeightAt, ceilingHeightAt); Unit heightDiff = player.mCamera.height - prevHeight; @@ -922,7 +917,6 @@ int main() if (heightDiff == 0) player.mVericalSpeed = 0; // hit floor/ceiling - if (player.mVericalSpeed == 0 && p.bBtn()) { int16_t camX = divRoundDown(player.mCamera.position.x,UNITS_PER_SQUARE); @@ -930,10 +924,10 @@ int main() if (player.mCamera.height - CAMERA_COLL_HEIGHT_BELOW - floorHeightAt(camX,camY) < 2) - player.mVericalSpeed = 200; // jump + player.mVericalSpeed = 400; // jump } - player.mVericalSpeed -= 20; // gravity + player.mVericalSpeed -= 80; // gravity } }