Add basic movement

This commit is contained in:
2023-11-12 19:04:25 +01:00
parent 526d292fb5
commit bf543330e5
10 changed files with 52 additions and 5 deletions

View File

@@ -9,6 +9,9 @@ void renderEntities(ecs_iter_t *it) {
for (i32 i = 0; i < it->count; i++) {
Rectangle dst = {p[i].x, p[i].y, s[i].x, s[i].y};
Vector2 origin = {dst.width * 0.5f, dst.height * 0.5f};
DrawTexturePro(t[i].texture, t[i].rec, dst, origin, r[i], WHITE);
Rectangle src = t[i].rec;
if (t[i].flipX) src.width *= -1.0f;
if (t[i].flipY) src.height *= -1.0f;
DrawTexturePro(t[i].texture, src, dst, origin, r[i], WHITE);
}
}