From 734b0b58cbb14e333295a663feb2f7e068e25304 Mon Sep 17 00:00:00 2001 From: zvon Date: Wed, 26 May 2021 17:48:33 +0200 Subject: [PATCH] Mario: fix floor detect and top movement helper --- mario/mario.cpp | 2 +- mario/mario_visitor.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mario/mario.cpp b/mario/mario.cpp index 8d2a4a0..caf0805 100644 --- a/mario/mario.cpp +++ b/mario/mario.cpp @@ -11,7 +11,7 @@ Mario::Mario(const std::shared_ptr< SDLPP::Renderer > &renderer) : SDLPP::Rectan pauseAnimation(); setMovement( 0, 0 ); setMovementSpeed( 1 ); - auto bottom_detect = SDLPP::RectColider( 0.3, 1, 0.4, 0, MARIO_FLOOR_DETECT ); + auto bottom_detect = SDLPP::RectColider( 0.2, 1, 0.6, 0, MARIO_FLOOR_DETECT ); bottom_detect.setMinHeight(1); addCollision(bottom_detect); addCollision( diff --git a/mario/mario_visitor.hpp b/mario/mario_visitor.hpp index 2f88ca7..6c64c1e 100644 --- a/mario/mario_visitor.hpp +++ b/mario/mario_visitor.hpp @@ -45,7 +45,7 @@ public: return top_hit; } bool moveTop() { - return top_left_right; + return top_left_right && !top_hit; } const SDLPP::Vec2D &getRightLeftPos() { return rightleftpos;