Пример #1
0
void Actor::Update(float dt)
{
	UpdateSpriteAnimation(dt);
	
	if (_positionInterval.ShouldStep())
	{
		SetPosition(_positionInterval.Step(dt));
		if (!_positionInterval.ShouldStep())
		{
			if (_positionIntervalMessage != "")
			{
				theSwitchboard.Broadcast(new Message(_positionIntervalMessage, this));
			}
		}
	}
	if (_rotationInterval.ShouldStep())
	{
		SetRotation(_rotationInterval.Step(dt));
		if (!_rotationInterval.ShouldStep())
		{
			if (_rotationIntervalMessage != "")
			{
				theSwitchboard.Broadcast(new Message(_rotationIntervalMessage, this));
			}
		}
	}
	if (_colorInterval.ShouldStep())
	{
		SetColor(_colorInterval.Step(dt));
		if (!_colorInterval.ShouldStep())
		{
			if (_colorIntervalMessage != "")
			{
				theSwitchboard.Broadcast(new Message(_colorIntervalMessage, this));
			}
		}
	}
	if (_sizeInterval.ShouldStep())
	{
		Vector2 newSize = _sizeInterval.Step(dt);
		SetSize(newSize.X, newSize.Y);
		if (!_sizeInterval.ShouldStep())
		{
			if (_sizeIntervalMessage != "")
			{
				theSwitchboard.Broadcast(new Message(_sizeIntervalMessage, this));
			}
		}
	}
}
Пример #2
0
void Actor::Update(float dt)
{
	UpdateSpriteAnimation(dt);
}