Teleportation in editor

This commit is contained in:
2022-11-19 22:53:24 +01:00
parent 6ac2726a94
commit 9402f2afa2
12 changed files with 255 additions and 19 deletions
+4 -2
View File
@@ -6,10 +6,12 @@
void MarioVisitor::visit(const SDLPP::RenderObject &obj) {
auto id = obj.getId();
switch (id) {
case PIPE_LEFT_BOTTOM_ID:
case PIPE_RIGHT_BOTTOM_ID:
case PIPE_LEFT_TOP_ID:
case PIPE_RIGHT_TOP_ID:
teleport_bottom = true;
// fallthrough
case PIPE_LEFT_BOTTOM_ID:
case PIPE_RIGHT_BOTTOM_ID:
{
auto m_obj = dynamic_cast<const MarioBlock &>(obj);
if(m_obj.hasTeleport()) {
+4
View File
@@ -136,6 +136,9 @@ public:
void setTeleportLevel(const std::string &level) {
teleport_level = level;
}
bool teleportBottom() {
return teleport_bottom;
}
private:
bool onGround = false;
@@ -165,6 +168,7 @@ private:
bool _death = false;
bool _instant_death = false;
std::string teleport_level = "";
bool teleport_bottom = false;
};
#endif
-1
View File
@@ -46,7 +46,6 @@ void ProjectileVisitor::visit(const SDLPP::RenderObject &obj) {
}
break;
case GOOMBA_ID:
std::cout << "DEATH" << std::endl;
death = true;
default:
break;