Example #1
0
void Ship::updateCurrent(sf::Time dt, CommandQueue& commands)
{
	// Entity has been destroyed
	if (isDestroyed())
	{
		_isMarkedForRemoval = true;
		return;
	}

	// Check if bullets fired
	checkProjectileLaunch(dt, commands);

	// Update enemy movement pattern; apply velocity & friction
	Entity::updateCurrent(dt, commands);
    setVelocity((1-0.025)*getVelocity().x, (1-0.025)*getVelocity().y);
    
    // Ship is invulnerable after respawn
    if(_godmode)
        _invisTimer += dt;
    if(_invisTimer >= sf::seconds(3))
    {
        _invisTimer = sf::Time::Zero;
        _godmode = 0;
    }
}
Example #2
0
void Aircraft::updateCurrent(sf::Time dt, CommandQueue& commands)
{
    if (isDestroyed())
    {
        checkPickupDrop(commands);
        mIsMarkedForRemoval = true;
        return;
        
    }
    checkProjectileLaunch(dt, commands);
    updateMovementPattern(dt);
    Entity::updateCurrent(dt, commands);
    updateText();
}
Example #3
0
void Aircraft::updateCurrent(sf::Time dt, CommandQueue& commands)
{
	// Entity has been destroyed: Possibly drop pickup, mark for removal
	if (isDestroyed())
	{
		checkPickupDrop(commands);

		mIsMarkedForRemoval = true;
		return;
	}

	// Check if bullets or missiles are fired
	checkProjectileLaunch(dt, commands);

	// Update enemy movement pattern; apply velocity
	updateMovementPattern(dt);
	Entity::updateCurrent(dt, commands);

	// Update texts
	updateTexts();
}