summaryrefslogtreecommitdiff
path: root/lib/world.h
diff options
context:
space:
mode:
authorJoel Stålnacke <joel@saker.fi>2024-10-11 13:31:44 +0300
committerJoel Stålnacke <joel@saker.fi>2024-10-13 13:34:46 +0300
commit53a1cdf5bee2955995dfbf441f5354d1dcfc1e0c (patch)
treebe8c2894226a2b7e1a47f7583f2041df75f795b3 /lib/world.h
parent4bac6ae2e725a1997674fd3369bf4ea032235d8b (diff)
Add Godot client
Diffstat (limited to 'lib/world.h')
-rw-r--r--lib/world.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/world.h b/lib/world.h
new file mode 100644
index 0000000..40c3fef
--- /dev/null
+++ b/lib/world.h
@@ -0,0 +1,31 @@
+#define WORLD_MAX_ENTITIES 5000
+
+enum {
+ ENTITY_NONE,
+ ENTITY_BALL
+};
+
+struct entity_ball {
+ vec2 pos;
+ vec2 vel;
+};
+
+union entity_union {
+ struct entity_ball ball;
+};
+
+struct entity {
+ int kind;
+ union entity_union e;
+};
+
+struct world;
+
+struct world *dp_world_create();
+void dp_world_free(struct world *);
+
+int dp_world_create_entity(struct world *, int kind);
+struct entity *dp_world_find_entity(struct world *, int entity_id);
+int dp_world_remove_entity(struct world *, int entity_id);
+
+int dp_world_tick(struct world *, double delta);