diff options
| author | Flenk008 <frenk_0_0@hotmail.com> | 2023-03-09 20:35:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-09 20:35:34 +0100 |
| commit | c9d9e6927fd514667aae0e985ada42a736411450 (patch) | |
| tree | 3bf1b69f4be518a7b5b4810c09053d95bc5399a8 /src/stm32/TODO/hh_entity.h | |
| parent | 569558ea9502b5e07ac4825ca94cadef0e65f0cf (diff) | |
| parent | c63bbb2483eef7d07079f950096463abc01ce16f (diff) | |
Merge pull request #3 from lonkaars/game-engine
Game engine
Diffstat (limited to 'src/stm32/TODO/hh_entity.h')
| -rw-r--r-- | src/stm32/TODO/hh_entity.h | 20 |
1 files changed, 20 insertions, 0 deletions
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); |