fix: enemy drag is now applied using deltatime
This commit is contained in:
parent
a27acee155
commit
0616d1d3a1
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue