Mario: proper position when standing on ground

This commit is contained in:
2021-05-22 22:36:53 +02:00
parent d04cbea02d
commit 0358aa36c7
3 changed files with 11 additions and 4 deletions
+5 -3
View File
@@ -6,12 +6,14 @@ void MarioVisitor::visit( const SDLPP::RenderObject &obj ) {
auto id = obj.getId();
switch ( id ) {
case FLOOR_ID:
if ( from == MARIO_FLOOR_DETECT )
if ( from == MARIO_FLOOR_DETECT ) {
onGround = true;
else if ( from == MARIO_LEFT_SIDE_DETECT )
groundY = obj.getPos().getY();
} else if ( from == MARIO_LEFT_SIDE_DETECT ) {
left = true;
else if (from == MARIO_RIGHT_SIDE_DETECT )
} else if (from == MARIO_RIGHT_SIDE_DETECT ) {
right = true;
}
break;
case DEATH_ID:
death = true;