Mario: mario detects enemies and bounces when he kills them/dies when they kill him

This commit is contained in:
2021-08-08 21:40:00 +02:00
parent 45ac4dad64
commit 94bf4fc39d
4 changed files with 21 additions and 3 deletions
+8
View File
@@ -53,6 +53,14 @@ void MarioVisitor::visit( const SDLPP::RenderObject &obj ) {
death = true;
_quit = true;
break;
case GOOMBA_ID:
if(from != MARIO_FLOOR_DETECT && from != MARIO_ENEMY_DETECT) {
death = true;
_quit = true;
} else {
_bounce = true;
}
break;
case STOP_MOVEMENT:
stop = true;
newX = obj.getDoubleRect().first.getX() +