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
+7
View File
@@ -152,6 +152,7 @@ void loadMapV01(std::shared_ptr<SDLPP::Scene> &scene,
bool removeCollisions = false;
int coinCount = 0;
bool mushroom = false;
std::string teleport_level = "";
if (!editor && block.getModifierId() == DESTRUCTIBLE_MODIFIER_ID) {
destructible = true;
}
@@ -165,6 +166,9 @@ void loadMapV01(std::shared_ptr<SDLPP::Scene> &scene,
if (!editor && block.getModifierId() == MUSHROOM_MODIFIER_ID) {
mushroom = true;
}
if (!editor && block.getModifierId() == TELEPORT_MODIFIER_ID) {
teleport_level = "test.marmap";
}
// TODO add modifiers to createTerrainBlock
if (block.getTerrainId() != 0) {
auto obj = createTerrainBlock(block.getTerrainId(),
@@ -175,6 +179,9 @@ void loadMapV01(std::shared_ptr<SDLPP::Scene> &scene,
if (mushroom) {
obj->addMushroom();
}
if (!teleport_level.empty()) {
obj->setTeleportLevel(teleport_level);
}
if (removeCollisions) {
obj->removeCollisions();
}