예제 #1
0
void Enemy::update(TimeDuration dt)
{
	if (_pathPoint.reachedEnd())
	{
		if (_listener != nullptr)
			_listener->onReachedEnd(*this);
	}

	_pathPoint.advance(dt.toSecs() * _speed);

	for (auto& polygon : _polygons)
	{
		auto& model = _scene.model(polygon.polygon.modelId());

		model.transform().translation() = _pathPoint.currentPosition();

		polygon.update(_scene, dt);
	}
}
예제 #2
0
void Enemy::NormalAnimator::update(TimeDuration dt,
								   gr::Model<gr::Transform2>& model)
{
	model.transform().rotation() += angularVelocity * dt.toSecs();
}