From 704e19f2f016da7d476df9be99f9dc91fa959247 Mon Sep 17 00:00:00 2001 From: Anonymus Raccoon Date: Thu, 2 Apr 2020 14:53:34 +0200 Subject: [PATCH] Fixing invalid timings with the movements of the player --- include/components/controllable_component.h | 2 +- src/systems/map_movement_system.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/components/controllable_component.h b/include/components/controllable_component.h index bc95fc1..0d01263 100644 --- a/include/components/controllable_component.h +++ b/include/components/controllable_component.h @@ -15,7 +15,7 @@ struct controllable_component gc_component base; int movement_x; int movement_y; - int move_callback; + float move_callback; }; extern const struct controllable_component controllable_component; \ No newline at end of file diff --git a/src/systems/map_movement_system.c b/src/systems/map_movement_system.c index c9d81f1..d8f39b5 100644 --- a/src/systems/map_movement_system.c +++ b/src/systems/map_movement_system.c @@ -48,9 +48,9 @@ float dtime) link->tile->entity = NULL; new_tile->entity = entity; engine->trigger_event(engine, "entity_moved", entity, link->tile); - ctl->move_callback = 10; + ctl->move_callback = .2f; } - ctl->move_callback--; + ctl->move_callback -= dtime; } static void ctr(void *system, va_list list)