Teleportation in editor
This commit is contained in:
@@ -41,10 +41,13 @@ void MushroomBlock::setParent(MarioBlock *parent) {
|
||||
}
|
||||
|
||||
void MushroomBlock::handleVisitor(SDLPP::Visitor &visitor) {
|
||||
auto &m_visitor = dynamic_cast<MushroomVisitor &>(visitor);
|
||||
if (m_visitor.getDeath()) {
|
||||
destroy();
|
||||
}
|
||||
if (!_started_movement) {
|
||||
return;
|
||||
}
|
||||
auto &m_visitor = dynamic_cast<MushroomVisitor &>(visitor);
|
||||
setOnGround(m_visitor.isOnGround());
|
||||
if (isOnGround()) {
|
||||
setPos(getPos().getX(), m_visitor.getGroundY() - BLOCK_SIZE);
|
||||
@@ -53,9 +56,6 @@ void MushroomBlock::handleVisitor(SDLPP::Visitor &visitor) {
|
||||
setPos(m_visitor.getValidXPos(), getPos().getY());
|
||||
setMovement(-getMovement().getX(), getMovement().getY());
|
||||
}
|
||||
if (m_visitor.getDeath()) {
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
|
||||
void MushroomBlock::setFireFlower(bool fire_flower) {
|
||||
|
||||
Reference in New Issue
Block a user