Teleportation in editor
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -46,7 +46,6 @@ void ProjectileVisitor::visit(const SDLPP::RenderObject &obj) {
|
||||
}
|
||||
break;
|
||||
case GOOMBA_ID:
|
||||
std::cout << "DEATH" << std::endl;
|
||||
death = true;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user