From cb31bc5a4404399cdd720895a7c3f0fc8881bba6 Mon Sep 17 00:00:00 2001 From: UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> Date: Tue, 7 Mar 2023 16:26:50 +0100 Subject: some func defenitions for game-engine and foundation --- src/stm32/TODO/hh_entity.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/stm32/TODO/hh_entity.h (limited to 'src/stm32/TODO/hh_entity.h') diff --git a/src/stm32/TODO/hh_entity.h b/src/stm32/TODO/hh_entity.h new file mode 100644 index 0000000..82d75c5 --- /dev/null +++ b/src/stm32/TODO/hh_entity.h @@ -0,0 +1,20 @@ +#include "maths.h" + +typedef struct hh_entity +{ + vec2 pos, direction; + int8_t hp; + //armor/block? +}; + +/// @brief detect for collision enity and eviroment +/// @param environment position of tile to be checked +/// @param entity position entity +/// @return true if collision between enity and environment +bool hh_collision(const vec2& environment, const vec2& entity); + +/// @brief solve collisions +/// @param environment position +/// @param entity position +/// @return solved new entity position +vec2 hh_solve_collision(const vec2& environment, const vec2& entity); -- cgit v1.2.3