Add texture flipping

This commit is contained in:
2023-12-05 11:38:09 +01:00
parent 17a5cee02c
commit 8d01f328f9

View File

@@ -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;
}
}
}