aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeander Scherer <leander@schererleander.de>2026-03-09 01:04:36 +0100
committerLeander Scherer <leander@schererleander.de>2026-03-09 01:04:36 +0100
commitd7855a2b93be4aa1008643e54249cb739986869e (patch)
tree973e4ba750605b163d1b95add0335242852c040d /include
parent23ab420f0d13f6e0bde5fe869224f6f41e86fe4d (diff)
feat(entity): add entity manager and pickup system
Diffstat (limited to 'include')
-rw-r--r--include/entity.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/include/entity.h b/include/entity.h
new file mode 100644
index 0000000..60467ab
--- /dev/null
+++ b/include/entity.h
@@ -0,0 +1,61 @@
+#ifndef ENTITY_H
+#define ENTITY_H
+
+#include "raylib.h"
+#include "raytmx.h"
+
+#include "player.h"
+#include "map_manager.h"
+
+typedef struct Enemy {
+ Vector2 position;
+ Rectangle bounds;
+ uint32_t gid;
+ int health;
+ bool active;
+} Enemy;
+
+typedef struct Static {
+ Vector2 position;
+ Rectangle bounds;
+ uint32_t gid;
+ bool active;
+} Static;
+
+typedef struct Collectible {
+ Vector2 position;
+ Rectangle bounds;
+ uint32_t gid;
+ bool active;
+ int tileX;
+ int tileY;
+} Collectible;
+
+typedef struct Movable {
+ Vector2 position;
+ Rectangle bounds;
+ uint32_t gid;
+ bool active;
+} Movable;
+
+typedef struct EntityManager {
+ Enemy *enemies;
+ int enemiesCount;
+
+ Collectible *collectibles;
+ int collectiblesCount;
+
+ Static *statics;
+ int staticsCount;
+
+ Movable *movables;
+ int movablesCount;
+} EntityManager;
+
+EntityManager InitEntityManager(uint32_t capacity);
+void SpawnEntitiesFromMap(EntityManager *mgr, TmxMap *map);
+void UpdateEntities(EntityManager *mgr, Player *player, MapManager *mapMgr);
+void DrawEntities(EntityManager *mgr, TmxMap *map);
+void UnloadEntityManager(EntityManager *mgr);
+
+#endif // ENTITY_H