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();
|
pauseAnimation();
|
||||||
setMovement( 0, 0 );
|
setMovement( 0, 0 );
|
||||||
setMovementSpeed( 1 );
|
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);
|
bottom_detect.setMinHeight(1);
|
||||||
addCollision(bottom_detect);
|
addCollision(bottom_detect);
|
||||||
addCollision(
|
addCollision(
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
return top_hit;
|
return top_hit;
|
||||||
}
|
}
|
||||||
bool moveTop() {
|
bool moveTop() {
|
||||||
return top_left_right;
|
return top_left_right && !top_hit;
|
||||||
}
|
}
|
||||||
const SDLPP::Vec2D<double> &getRightLeftPos() {
|
const SDLPP::Vec2D<double> &getRightLeftPos() {
|
||||||
return rightleftpos;
|
return rightleftpos;
|
||||||
|
Loading…
Reference in New Issue
Block a user