sprite = new Sprite(*other.sprite);
}
-MovingSprite&
+MovingSprite&
MovingSprite::operator=(const MovingSprite& other)
{
if (this == &other) return *this;
sprite->draw(context, get_pos(), layer);
}
-void
+void
MovingSprite::update(float )
{
}
-void
+void
MovingSprite::set_action(const std::string& action, int loops)
{
sprite->set_action(action, loops);
set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
}
-void
+void
MovingSprite::set_action_centered(const std::string& action, int loops)
{
Vector old_size = bbox.get_size();
set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height());
set_pos(get_pos() - (bbox.get_size() - old_size) / 2);
}
-