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 -4
View File
@@ -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) {