summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorOrangerot <purple@orangerot.dev>2025-06-12 00:51:42 +0200
committerOrangerot <purple@orangerot.dev>2025-06-12 00:51:42 +0200
commitf13cac1a0d67418dbce84ad4baad59af3327117b (patch)
treed2b794c079da2371230c66ad32aca5a48aefc5c8 /main.c
parentfe42371c8c5b80b174372de846fafb7590fc3ff1 (diff)
feat: draw world bounds and add world_roomHEADmain
Diffstat (limited to 'main.c')
-rw-r--r--main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/main.c b/main.c
index 606f575..636c812 100644
--- a/main.c
+++ b/main.c
@@ -49,8 +49,6 @@ int main(void) {
enum Asset tree = tree_oak;
enum Asset house = tent_detailedOpen;
- Vector3 position = {0};
-
LoadModels();
struct World world_terrain = {
@@ -59,7 +57,14 @@ int main(void) {
.size = 32
};
+ struct World world_room = {
+ .floor = assets[floorFull],
+ .wall = assets[wall],
+ .size = 8
+ };
+
gen_terrain(&world_terrain);
+ gen_room(&world_room);
// #define NUM_TREES MAP_SIZE * MAP_SIZE / 100
// int *trees_x = LoadRandomSequence(NUM_TREES, -MAP_SIZE / 2, MAP_SIZE / 2);
@@ -88,12 +93,12 @@ int main(void) {
BeginDrawing();
ClearBackground(RAYWHITE);
BeginMode3D(camera);
- draw_world(&world_terrain);
+ draw_world(IsKeyDown(KEY_SPACE) ? &world_room : &world_terrain);
// for (int tree_i = 0; tree_i < NUM_TREES; tree_i++) {
// DrawModel(assets[tree], (Vector3) {trees_x[tree_i], 0, trees_y[tree_i]}, 1.f, WHITE);
// }
DrawModel(assets[house], (Vector3) {-1, 0, 0}, 1.f, WHITE);
- DrawGrid(20, 10.0f);
+ DrawGrid(20, 1.f);
Vector3 capsule_top = player_pos;
capsule_top.y += 0.2f;
DrawCapsule(Vector3Add(player_pos, (Vector3){0,.1f,0}), capsule_top, .1f, 8, 8, BLUE);