summaryrefslogtreecommitdiff
path: root/src/world.h
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2026-01-27 20:10:55 -0600
committerAaditya Dhruv <[email protected]>2026-01-27 20:10:55 -0600
commitde3c9942416382aae0f2f2aac3b67c1e8b4d71f1 (patch)
tree3776e5ba74dd45ee7ce41bb397ec97e187dcc325 /src/world.h
parent6aabb8b3ca8284ac2d27af36459393321742d8f5 (diff)
Add support for chunk and world
- Chunk is a array of blocks - World is a array of chunks - Basic chunk plains generation based on simple linear functions - Bunch of functions still not implemented, in design phase
Diffstat (limited to 'src/world.h')
-rw-r--r--src/world.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/world.h b/src/world.h
new file mode 100644
index 0000000..5be1cf2
--- /dev/null
+++ b/src/world.h
@@ -0,0 +1,13 @@
+#pragma once
+#include "chunk.h"
+#include <stdint.h>
+#define WORLD_LENGTH 32
+#define WORLD_WIDTH 32
+struct world {
+ struct chunk* chunks[WORLD_WIDTH][WORLD_LENGTH];
+ int32_t seed;
+};
+
+int world_init(int32_t seed);
+int world_save(int32_t seed);
+int world_get_chunk(struct world* world, vec2 coord, struct chunk* chunk);