diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-09 20:14:38 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-09 20:21:00 +0100 |
commit | abc0ca438938d9ccad9097a671556988b7625696 (patch) | |
tree | 514468365bfa1b83411fc673a3b84b4f87c8fab8 /editor/character.hpp | |
parent | 2b38bfa07bf20afc27646c5fdf43f0e3899bf914 (diff) |
editor: add some wip character stuff
Diffstat (limited to 'editor/character.hpp')
-rw-r--r-- | editor/character.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/editor/character.hpp b/editor/character.hpp new file mode 100644 index 00000000..b201be8f --- /dev/null +++ b/editor/character.hpp @@ -0,0 +1,30 @@ +#pragma once +#include "src/global-coords.hpp" +#include "src/rotation.hpp" +#include <memory> + +namespace floormat { + +struct anim_atlas; +struct world; + +struct character_wip final +{ + character_wip(); + ~character_wip(); + void tick(world& w, float dt, int left_right, int top_bottom); + + std::shared_ptr<anim_atlas> walk_anim; + global_coords pos; + std::size_t frame = 0; + float delta = 0; + Vector2 offset; + Vector2ub bbox_size; + rotation r = rotation::NE; + +private: + int allocate_frame_time(float dt); + static Vector2 move_vec(int left_right, int top_bottom); +}; + +} // namespace floormat |