diff options
Diffstat (limited to 'client/map/tiles')
-rw-r--r-- | client/map/tiles/grass.gd | 36 | ||||
-rw-r--r-- | client/map/tiles/grass.tscn | 2 | ||||
-rw-r--r-- | client/map/tiles/grass_side.tscn | 2 | ||||
-rw-r--r-- | client/map/tiles/path.gd | 23 | ||||
-rw-r--r-- | client/map/tiles/path.res | bin | 0 -> 1907 bytes | |||
-rw-r--r-- | client/map/tiles/path.tscn | 10 |
6 files changed, 71 insertions, 2 deletions
diff --git a/client/map/tiles/grass.gd b/client/map/tiles/grass.gd new file mode 100644 index 00000000..15ee7603 --- /dev/null +++ b/client/map/tiles/grass.gd @@ -0,0 +1,36 @@ +# Undercooked - a game about cooking +# Copyright 2024 nokoe +# 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/>. +# +class_name Grass +extends Tile + +const GRASS_SIDE: PackedScene = preload("res://map/tiles/grass_side.tscn") +const GRASS_COUNT: int = 16 + +func _init(rename: String, _neighbors: Array): + super(rename, _neighbors) + var grass_tile = preload("res://map/tiles/grass.tscn").instantiate() + grass_tile.position += Vector3(0.5, 0, 0.5) + add_child(grass_tile) + + var random = RandomNumberGenerator.new() + random.seed = rename.hash() + + for _i in Global.get_setting("grass_amount"): + var g: Node3D = GRASS_SIDE.instantiate() + grass_tile.add_child(g) + g.position = Vector3(random.randf_range(-.5, .5), 0, random.randf_range(-.5, .5)) + g.rotation = Vector3(0, random.randf_range(0, PI), 0) diff --git a/client/map/tiles/grass.tscn b/client/map/tiles/grass.tscn index 31ff6a69..649cc6c1 100644 --- a/client/map/tiles/grass.tscn +++ b/client/map/tiles/grass.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://bi6o7lbvhunj1"] -[ext_resource type="ArrayMesh" path="res://map/tiles/grass.res" id="1_pjjrj"] +[ext_resource type="ArrayMesh" uid="uid://dyu8iuolwqr5l" path="res://map/tiles/grass.res" id="1_pjjrj"] [node name="Grass" type="Node3D"] diff --git a/client/map/tiles/grass_side.tscn b/client/map/tiles/grass_side.tscn index c49ea4ca..08e04505 100644 --- a/client/map/tiles/grass_side.tscn +++ b/client/map/tiles/grass_side.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://dbp0ts6tfycev"] -[ext_resource type="ArrayMesh" path="res://map/tiles/grass_side.tres" id="1_u044x"] +[ext_resource type="ArrayMesh" uid="uid://l2by4gv4wpd1" path="res://map/tiles/grass_side.tres" id="1_u044x"] [node name="GrassSide" type="Node3D"] diff --git a/client/map/tiles/path.gd b/client/map/tiles/path.gd new file mode 100644 index 00000000..76c49b64 --- /dev/null +++ b/client/map/tiles/path.gd @@ -0,0 +1,23 @@ +# Undercooked - a game about cooking +# Copyright 2024 nokoe +# +# 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/>. +# +class_name Path +extends Tile + +func _init(rename: String, _neighbors: Array): + super(rename, _neighbors) + var path_tile = preload("res://map/tiles/path.tscn").instantiate() + path_tile.position += Vector3(0.5, 0, 0.5) + add_child(path_tile) diff --git a/client/map/tiles/path.res b/client/map/tiles/path.res Binary files differnew file mode 100644 index 00000000..e775b24e --- /dev/null +++ b/client/map/tiles/path.res diff --git a/client/map/tiles/path.tscn b/client/map/tiles/path.tscn new file mode 100644 index 00000000..1951680b --- /dev/null +++ b/client/map/tiles/path.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://beo16fa7lo12g"] + +[ext_resource type="ArrayMesh" uid="uid://1jelocokc0vu" path="res://map/tiles/path.res" id="1_6fqu5"] + +[node name="Path" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, -0.3, 0) +mesh = ExtResource("1_6fqu5") +skeleton = NodePath("") |