diff options
author | tpart <tpart120@proton.me> | 2025-09-21 18:43:39 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2025-09-21 18:43:39 +0200 |
commit | 443c8aab02735f2e9b9c044f44dd88cb92551fa6 (patch) | |
tree | 3ccb65b418644230fb8e98959beb8539ce0f536a /client/map | |
parent | d0863dba87125380467e6c4275343608c716e217 (diff) | |
download | hurrycurry-443c8aab02735f2e9b9c044f44dd88cb92551fa6.tar hurrycurry-443c8aab02735f2e9b9c044f44dd88cb92551fa6.tar.bz2 hurrycurry-443c8aab02735f2e9b9c044f44dd88cb92551fa6.tar.zst |
Use kitchen background in setup menu
Diffstat (limited to 'client/map')
-rw-r--r-- | client/map/kitchen_background.gd | 47 | ||||
-rw-r--r-- | client/map/kitchen_background.gd.uid | 1 | ||||
-rw-r--r-- | client/map/kitchen_background.tscn | 35 |
3 files changed, 83 insertions, 0 deletions
diff --git a/client/map/kitchen_background.gd b/client/map/kitchen_background.gd new file mode 100644 index 00000000..4b728a94 --- /dev/null +++ b/client/map/kitchen_background.gd @@ -0,0 +1,47 @@ +# Hurry Curry! - a game about cooking +# Copyright (C) 2025 Hurry Curry! contributors +# +# 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 = $Map + +func _ready() -> void: + init_map() + +func init_map(): + var map_tile = func (t): match t: + ".": return "floor" + "=": return "counter" + "s": return "stove" + "c": return "chair" + "t": return "table" + "o": return "oven" + "#": return "wall" + _: push_error("unknown tile: ", t) + var tiles = [ + "...............", + "###############", + "=oo==ss===.ctc#", + "..............#", + ".............=#", + ".............=#", + ".............=#" + ].map(func (l): return Array(l.split("")).map(map_tile)) + var gt = func (e): return null if e[1] >= tiles.size() else null if e[0] >= tiles[e[1]].size() else tiles[e[1]][e[0]] + var co = Vector2i(floor(tiles[0].size() / 2), floor(tiles.size() - 2)) + for y in tiles.size(): + for x in tiles[y].size(): + map.set_tile(Vector2i(x,y) - co, gt.call([x,y]), [[x,y-1],[x-1,y],[x,y+1],[x+1,y]].map(gt)) + map.flush() diff --git a/client/map/kitchen_background.gd.uid b/client/map/kitchen_background.gd.uid new file mode 100644 index 00000000..fc17de34 --- /dev/null +++ b/client/map/kitchen_background.gd.uid @@ -0,0 +1 @@ +uid://ddpr5p4c6p8pn diff --git a/client/map/kitchen_background.tscn b/client/map/kitchen_background.tscn new file mode 100644 index 00000000..af046095 --- /dev/null +++ b/client/map/kitchen_background.tscn @@ -0,0 +1,35 @@ +[gd_scene load_steps=4 format=3 uid="uid://wwu574dq2r8h"] + +[ext_resource type="PackedScene" uid="uid://b4gone8fu53r7" path="res://map/map.tscn" id="1_heqla"] +[ext_resource type="Script" uid="uid://ddpr5p4c6p8pn" path="res://map/kitchen_background.gd" id="1_ppf8f"] + +[sub_resource type="Environment" id="Environment_ex25y"] +background_mode = 1 +background_color = Color(0.145548, 0.151043, 0.207031, 1) + +[node name="KitchenBackground" type="Node3D"] +script = ExtResource("1_ppf8f") + +[node name="Map" parent="." instance=ExtResource("1_heqla")] +transform = Transform3D(0.866025, 0, 0.5, 0, 1, 0, -0.5, 0, 0.866025, 0, 0, 0) + +[node name="SpotLight3D" type="SpotLight3D" parent="."] +transform = Transform3D(0.63153476, -0.57124585, 0.52425385, 0.042865384, 0.700843, 0.71202654, -0.7741617, -0.42719722, 0.46709338, 1.79161, 3.07541, 1.58055) +light_energy = 2.689 +spot_range = 20.159 +spot_angle = 17.9256 + +[node name="SpotLight3D2" type="SpotLight3D" parent="."] +transform = Transform3D(0.32456997, 0.109091125, -0.93954957, 0.060483694, 0.9888999, 0.13571544, 0.94392586, -0.100876585, 0.314369, -5.22608, 2.10824, 2.35824) +light_energy = 2.689 +spot_range = 20.159 +spot_angle = 17.9256 + +[node name="SpotLight3D3" type="SpotLight3D" parent="."] +transform = Transform3D(0.11408793, -0.017399698, 0.99331826, 0.061045162, 0.9980801, 0.010471746, -0.9915934, 0.059442576, 0.114931054, 8.10732, 0.437069, 2.35824) +light_energy = 2.689 +spot_range = 20.159 +spot_angle = 17.9256 + +[node name="WorldEnvironment" type="WorldEnvironment" parent="."] +environment = SubResource("Environment_ex25y") |