From b3176f613deb577e1a65da25f6a66c6a934bcfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 1 Sep 2018 09:07:27 +0200 Subject: [PATCH] Update --- game.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/game.cpp b/game.cpp index 1dadb34..566148f 100644 --- a/game.cpp +++ b/game.cpp @@ -43,14 +43,14 @@ Pokitto::Core p; Character player; Level level; -int16_t heightFunc(int16_t x, int16_t y) +Unit heightFunc(int16_t x, int16_t y) { - return level.getHeight(x,y); + return level.getHeight(x,y) * UNITS_PER_SQUARE; } void pixelFunc(PixelInfo pixel) { - p.display.color = pixel.hit.direction + 4; + p.display.color = pixel.isWall ? pixel.hit.direction + 4 : 3; p.display.drawPixel(pixel.position.x * 2,pixel.position.y); p.display.drawPixel(pixel.position.x * 2 + 1,pixel.position.y); } @@ -80,7 +80,6 @@ int main() const int16_t step = 50; const int16_t step2 = 10; - const int16_t step3 = 10; Vector2D d = angleToDirection(player.mCamera.direction); @@ -104,9 +103,9 @@ int main() player.mCamera.direction -= step2; if (p.bBtn()) - player.mCamera.height += step3; + player.mCamera.height += step; else if (p.cBtn()) - player.mCamera.height -= step3; + player.mCamera.height -= step; player.mCamera.position.x = clamp(player.mCamera.position.x,UNITS_PER_SQUARE / 2,10 * UNITS_PER_SQUARE - UNITS_PER_SQUARE / 2); player.mCamera.position.y = clamp(player.mCamera.position.y,UNITS_PER_SQUARE / 2,10 * UNITS_PER_SQUARE - UNITS_PER_SQUARE / 2);