Fix flipX

This commit is contained in:
2024-01-04 16:42:49 +01:00
parent cc6b1c1a35
commit c0b94a9cc3

View File

@@ -89,7 +89,6 @@ void entityUpdateKinematic(ecs_iter_t *it) {
Vector2 mouse = input->mouseDownWorld;
f32 rot = Vector2Angle(position[i], mouse) + 270 * DEG2RAD;
//rotation[i] = rot;
}
// Check for speeding and clip
@@ -98,13 +97,6 @@ void entityUpdateKinematic(ecs_iter_t *it) {
velocity[i] = Vector2Normalize(velocity[i]);
velocity[i] = Vector2Scale(velocity[i], maxSpeed);
}
// 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 = rotation[i] >= 0.0f * RAD2DEG && rotation[i] <= 180.0f * RAD2DEG;
}
}
}