From f13cac1a0d67418dbce84ad4baad59af3327117b Mon Sep 17 00:00:00 2001 From: Orangerot Date: Thu, 12 Jun 2025 00:51:42 +0200 Subject: feat: draw world bounds and add world_room --- main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'main.c') 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); -- cgit v1.2.3