void CPlayerBase::update(float elapsed) {
	PROFILE_FUNCTION("update base");
	if (camera.isValid()) {
		if (onCinematic) {
			UpdateCinematic(elapsed);
		}
		else if (controlEnabled || only_sense) {
			bool alive = !checkDead();
			if (alive && inputEnabled) {
				energy_decrease = energy_default_decrease; // Default if nobody change that this frame
				UpdateSenseVision();
				if (!only_sense) {
					UpdateMoves();
					UpdateInputActions();
				}
				setLife(getLife() - getDeltaTime() * energy_decrease);
			}
			Recalc();
			if (alive) {
				//UpdateMoves();
				myUpdate();
				update_msgs();
			}
		}
		//UpdateAnimation();
	}
}
Exemplo n.º 2
0
void Field::update()
{
	if (lastUpdate != totalTime) {
		lastUpdate = totalTime;

		myUpdate();
	}
}
Exemplo n.º 3
0
	void DrawingBasics::updateForDrawing() {
		float dt = 1.0f / 60.0f;//bugbug does this time to frame count? I think so
		if (getColorAnimation() != nullptr) {
			getColorAnimation()->update(dt);
		}
		if (getAnimationHelper() && getAnimationHelper()->isAnimationEnabled()) {
			getAnimationHelper()->update(dt);
		}
		myUpdate(); // call derived classes
	};