diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-10 15:06:01 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-10 15:32:46 +0100 |
commit | 09183eb08755b20804f26a4341ab30bcea89a697 (patch) | |
tree | 947cbb58e67ebda5053ec27250d1c53ea8341a88 /editor/update.cpp | |
parent | abc0ca438938d9ccad9097a671556988b7625696 (diff) |
editor: add placeholder character walking around
Diffstat (limited to 'editor/update.cpp')
-rw-r--r-- | editor/update.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/editor/update.cpp b/editor/update.cpp index 16a155f3..e9f178a1 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -5,6 +5,7 @@ #include "main/clickable.hpp" #include "floormat/events.hpp" #include "floormat/main.hpp" +#include "character.hpp" #include "chunk.inl" namespace floormat { @@ -208,6 +209,13 @@ void app::update_world(float dt) c.with_scenery_update(sc.index(), [&] { return sc.update(dt); }); } + + +void app::update_character(float dt) +{ + _character->tick(M->world(), dt, keys[key_left], keys[key_right], keys[key_up], keys[key_down]); +} + void app::set_cursor() { if (!cursor.in_imgui) @@ -234,6 +242,7 @@ void app::update(float dt) update_world(dt); do_camera(dt, keys, get_key_modifiers()); clear_non_repeated_keys(); + update_character(dt); set_cursor(); M->world().maybe_collect(); |