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);