From c82fbdddbc10c96085f2684a62ac5a464580d21e Mon Sep 17 00:00:00 2001 From: zakarya Date: Fri, 3 Mar 2023 14:33:13 -0800 Subject: [PATCH] make way for world generation --- server.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 091d9ba..b0910ce 100644 --- a/server.js +++ b/server.js @@ -27,7 +27,6 @@ var game_data = { } } var nodes = new Set(); -nodes.add(new Engine.node(new Engine.vector(70, 70), 0, game_data.world.biome.forest.tree.radius, game_data.world.biome.forest.tree.size, "tree")); var characters = new Set(); var server_fps = 20; var player_render_distance = 1000; @@ -155,4 +154,18 @@ function server_tick() { } } -setInterval(server_tick, 1000 / server_fps); \ No newline at end of file +setInterval(server_tick, 1000 / server_fps); + +function create_boulder(position) { + nodes.add(new Engine.node(position, 0, game_data.world.biome.forest.boulder.radius, game_data.world.biome.forest.boulder.size, "boulder")); +} +function create_tree(position) { + nodes.add(new Engine.node(position, 0, game_data.world.biome.forest.tree.radius, game_data.world.biome.forest.tree.size, "tree")); +} + +function generate_world() { + create_tree(new Engine.vector(70, 70)); + create_boulder(new Engine.vector(-100, 0)); +} + +generate_world(); \ No newline at end of file