From de3c9942416382aae0f2f2aac3b67c1e8b4d71f1 Mon Sep 17 00:00:00 2001 From: Aaditya Dhruv Date: Tue, 27 Jan 2026 20:10:55 -0600 Subject: 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 --- src/world.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/world.h (limited to 'src/world.h') 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 +#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); -- cgit