diff options
Diffstat (limited to 'client/menu')
-rw-r--r-- | client/menu/menu_background.gd | 17 | ||||
-rw-r--r-- | client/menu/menu_background.tscn | 5 |
2 files changed, 10 insertions, 12 deletions
diff --git a/client/menu/menu_background.gd b/client/menu/menu_background.gd index 0e8e87e1..62c38baa 100644 --- a/client/menu/menu_background.gd +++ b/client/menu/menu_background.gd @@ -1,23 +1,21 @@ # Undercooked - a game about cooking # Copyright 2024 metamuffin # Copyright 2024 tpart -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License only. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -# +# extends Node3D -@onready var map = $Map - const NULLS = [null,null,null,null] const BUCKETS = [[], ["floor","floor","floor","floor","tomato-crate", "raw-steak-crate"], ["table", "chair", "counter"], ["sink", "stove"]] @@ -28,5 +26,8 @@ func _ready(): var k = randf() * w var bucket = BUCKETS[int(floor(k * BUCKETS.size())) % BUCKETS.size()] if bucket.size() == 0: continue - var tile = bucket[randi() % bucket.size()] - map.update([x,y], tile, NULLS) + var tile_name = bucket[randi() % bucket.size()] + var tile = TileFactory.produce(tile_name, tile_name, NULLS) + + add_child(tile) + tile.position = Vector3(x, 0, y) diff --git a/client/menu/menu_background.tscn b/client/menu/menu_background.tscn index 88ccf49d..5c29e4ac 100644 --- a/client/menu/menu_background.tscn +++ b/client/menu/menu_background.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=11 format=3 uid="uid://l4vm07dtda4j"] +[gd_scene load_steps=10 format=3 uid="uid://l4vm07dtda4j"] [ext_resource type="Script" path="res://menu/menu_background.gd" id="1_ijsg0"] -[ext_resource type="PackedScene" uid="uid://cs8gxa22c6joh" path="res://map/map.tscn" id="2_eg8f5"] [ext_resource type="Shader" path="res://menu/menu_background.gdshader" id="3_5mp8y"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_uw50b"] @@ -42,8 +41,6 @@ shader_parameter/noise = SubResource("NoiseTexture2D_s4fnp") [node name="MenuBackground" type="Node3D"] script = ExtResource("1_ijsg0") -[node name="Map" parent="." instance=ExtResource("2_eg8f5")] - [node name="Camera" type="Camera3D" parent="."] transform = Transform3D(0.614606, 0.499662, -0.610408, -0.00282255, 0.775198, 0.631712, 0.78883, -0.386531, 0.477852, -9.13611, 4.90356, 1.22532) projection = 1 |