fix: enemy drag is now applied using deltatime

This commit is contained in:
Sara 2024-01-20 13:55:22 +01:00
parent a27acee155
commit 0616d1d3a1

View file

@ -96,7 +96,7 @@ void EnemyStart(Enemy* self) {}
void EnemyUpdate(Enemy* self, float deltaTime) { void EnemyUpdate(Enemy* self, float deltaTime) {
// apply drag // apply drag
Vector velocity = vmovetowardsf(rigidbody_get_velocity(self->rigidbody), ZeroVector, 0.1f); Vector velocity = vmovetowardsf(rigidbody_get_velocity(self->rigidbody), ZeroVector, 80.0f * deltaTime);
rigidbody_set_velocity(self->rigidbody, velocity); rigidbody_set_velocity(self->rigidbody, velocity);
// update state machine // update state machine
state_machine_update(self->behaviour, deltaTime); state_machine_update(self->behaviour, deltaTime);