Mario: fix floor detect and top movement helper
This commit is contained in:
parent
d2bc497070
commit
734b0b58cb
@ -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(
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
return top_hit;
|
||||
}
|
||||
bool moveTop() {
|
||||
return top_left_right;
|
||||
return top_left_right && !top_hit;
|
||||
}
|
||||
const SDLPP::Vec2D<double> &getRightLeftPos() {
|
||||
return rightleftpos;
|
||||
|
Loading…
Reference in New Issue
Block a user