diff --git a/game/systems_entity.c b/game/systems_entity.c index cc529e7..8425836 100644 --- a/game/systems_entity.c +++ b/game/systems_entity.c @@ -86,6 +86,13 @@ void entityUpdateKinematic(ecs_iter_t *it) { position[i].x += velocity[i].x * dt * 10; position[i].y += velocity[i].y * dt * 10; rotation[i] += angularVelocity[i] * dt * 10; + + // Update flipX + ecs_entity_t entity = it->entities[i]; + if (ecs_has(it->world, entity, TextureRegion)) { + TextureRegion *text = ecs_get_mut(it->world, entity, TextureRegion); + text->flipX = velocity[i].x < 0.0f; + } } }