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

@@ -1,5 +1,7 @@
#include "systems.h"
#include "../game_state.h"
void updateAnimations(ecs_iter_t *it) {
Animation *anim = ecs_field(it, Animation, 1);
TextureRegion *t = ecs_field(it, TextureRegion, 2);
@@ -7,6 +9,7 @@ void updateAnimations(ecs_iter_t *it) {
float dt = GetFrameTime();
for (i32 i = 0; i < it->count; i++) {
anim[i].frameDuration = GAME->frameDuration;
anim[i].elapsed += dt;
if (anim[i].elapsed < anim[i].frameDuration) continue;