EnemyPlane(sf::Sprite object, int initX, int destX, float duration) : LinearFlying(object, initX, destX, duration), Rotating(object), HasSprite(object) { auto degree = atan2(screenDimensions.y, destX - initX) * 360.0 / M_PI / 2 - 90; setFixedRotation(degree); }
/** Initializes a new power-up object with the supplied position and index. */ bool Powerup::init(const Vec2& pos, const PowerupType& t, int i) { if (CapsuleObstacle::init(pos)) { _type = t; _index = i; setDensity(0.0f); setFriction(0.0f); setFixedRotation(true); return true; } return false; };