Mario: teleport to hardcoded level

This commit is contained in:
2022-11-13 19:52:39 +01:00
parent 41ba43ed93
commit c5283000c7
14 changed files with 171 additions and 54 deletions
+11 -4
View File
@@ -6,13 +6,20 @@
void MarioVisitor::visit(const SDLPP::RenderObject &obj) {
auto id = obj.getId();
switch (id) {
case FLOOR_ID:
case BRICK_ID:
case BRICK_TOP_ID:
case PIPE_LEFT_BOTTOM_ID:
case PIPE_RIGHT_BOTTOM_ID:
case PIPE_LEFT_TOP_ID:
case PIPE_RIGHT_TOP_ID:
{
auto m_obj = dynamic_cast<const MarioBlock &>(obj);
if(m_obj.hasTeleport()) {
setTeleportLevel(m_obj.getTeleportLevel());
}
}
// fallthrough
case FLOOR_ID:
case BRICK_ID:
case BRICK_TOP_ID:
case STEP_ID:
case SIDEWAY_PIPE_END_TOP_ID:
case SIDEWAY_PIPE_END_BOTTOM_ID:
@@ -50,7 +57,7 @@ void MarioVisitor::visit(const SDLPP::RenderObject &obj) {
}
break;
case DEATH_ID:
_death = true;
_instant_death = true;
break;
case GOOMBA_ID:
if (from != MARIO_FLOOR_DETECT && from != MARIO_ENEMY_DETECT) {