From 1b30c0ee89cdc207430a6c2387caeae9b40ced27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sun, 9 Sep 2018 16:16:52 +0200 Subject: [PATCH] Update demo1 --- demo1.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/demo1.cpp b/demo1.cpp index 65619d3..c1c83e7 100644 --- a/demo1.cpp +++ b/demo1.cpp @@ -7,6 +7,8 @@ license: CC0 1.0 */ +#define CAMERA_COLL_HEIGHT_BELOW ((3 * UNITS_PER_SQUARE) / 2) + #include "general.hpp" #define LEVEL_X_RES 29 @@ -64,7 +66,7 @@ const signed char levelFloor[] = 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, - 40, 0,48, 0,-2,-2, 0,-8,-8,-8,-8, 0, 0, 0,-8,-8, 0, 0, 0, 0, 0, 0, 0, 0,24,24,15,24,24, + 40, 0,48, 0,-2,-2, 0,-8,-8,-8,-8, 0, 0, 0,-8,-8, 0, 0, 0, 0, 0, 0, 0, 0,24,24,10,24,24, 40, 0, 0, 0,-2,-2, 0, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0,24, 0, 0, 0,24, 40, 0, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,24, 0, 0, 0,24, 40,24,48,-2,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,24, @@ -77,8 +79,8 @@ const signed char levelFloor[] = const signed char levelCeiling[] = { 40,40,40,40,40,40,40,99,99,99,99,36,40,40,40,40,40,36,99,99,99,99,99,99,99,99,99,99,99, - 40,99,99,99,99,99,20,99,99,99,99,36,40,99,99,99,99,36,99,99,99,99,99,99,99,99,99,99,99, - 40,99,99,99,99,99,20,99,99,99,99,36,40,99,99,99,99,36,99,99,99,99,99,99,99,99,99,99,99, + 40,99,99,99,99,99,20,99,99,99,99,36,40,30,30,30,99,36,99,99,99,99,99,99,99,99,99,99,99, + 40,99,99,99,99,99,20,99,99,99,99,36,40,30,30,30,99,36,99,99,99,99,99,99,99,99,99,99,99, 40,99,99,99,99,99,48,99,99,99,99,36,24,24,24,24,24,36,99,99,99,99,99,99,99,99,99,99,99, 40,99,48,48,48,48,47,99,99,99,99,36,36,36,36,36,36,36,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, @@ -695,8 +697,7 @@ int main() sprites[0] = Sprite(sprite1,10,5,1,100); sprites[1] = Sprite(sprite1,14,5,1,100); - sprites[2] = Sprite(sprite2,15,19,1,150); - sprites[2].mHeight -= UNITS_PER_SQUARE / 2; + sprites[2] = Sprite(sprite2,15,19,1,200); pokitto.display.persistence = 1; pokitto.setFrameRate(FPS); @@ -781,7 +782,7 @@ int main() Unit prevHeight = player.mCamera.height; moveCameraWithCollision(&player.mCamera,moveOffset,player.mVericalSpeed, - floorHeightAt, ceilingHeightAt); + floorHeightAt, ceilingHeightAt, 1); Unit heightDiff = player.mCamera.height - prevHeight;