From 7c8bff5a0b853ec0eb4a2e9a9a7a2be2981e7e24 Mon Sep 17 00:00:00 2001 From: nokoe Date: Thu, 27 Jun 2024 14:52:49 +0200 Subject: add missing items --- client/map/item_factory.gd | 12 +++++++++++ client/map/items/bread_slice.gd | 21 +++++++++++++++++++ client/map/items/bread_slice_plate.gd | 21 +++++++++++++++++++ .../map/items/bread_slice_sliced_tomato_plate.gd | 23 +++++++++++++++++++++ .../items/bread_slice_sliced_tomato_steak_plate.gd | 23 +++++++++++++++++++++ client/map/items/bread_slice_steak_plate.gd | 23 +++++++++++++++++++++ client/map/items/exterior_tree.gd | 24 ---------------------- client/map/items/plate.gd | 2 +- client/map/items/pot.gd | 2 +- client/map/items/slice.gd | 21 ------------------- client/map/items/sliced_tomato_plate.gd | 21 +++++++++++++++++++ client/map/items/sliced_tomato_steak_plate.gd | 23 +++++++++++++++++++++ client/map/tiles/exterior_tree.gd | 24 ++++++++++++++++++++++ 13 files changed, 193 insertions(+), 47 deletions(-) create mode 100644 client/map/items/bread_slice.gd create mode 100644 client/map/items/bread_slice_plate.gd create mode 100644 client/map/items/bread_slice_sliced_tomato_plate.gd create mode 100644 client/map/items/bread_slice_sliced_tomato_steak_plate.gd create mode 100644 client/map/items/bread_slice_steak_plate.gd delete mode 100644 client/map/items/exterior_tree.gd delete mode 100644 client/map/items/slice.gd create mode 100644 client/map/items/sliced_tomato_plate.gd create mode 100644 client/map/items/sliced_tomato_steak_plate.gd create mode 100644 client/map/tiles/exterior_tree.gd (limited to 'client/map') diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd index 86e69d1d..d3da32ef 100644 --- a/client/map/item_factory.gd +++ b/client/map/item_factory.gd @@ -70,5 +70,17 @@ static func produce(name: String, owned_by: Node3D) -> Item: return TomatoSoupPlate.new(owned_by) "burned": return Burned.new(owned_by) + "bread-slice-plate": + return BreadSlicePlate.new(owned_by) + "bread-slice-steak-plate": + return BreadSliceSteakPlate.new(owned_by) + "bread-slice-sliced-tomato-plate": + return BreadSliceSlicedTomatoPlate.new(owned_by) + "bread-slice-sliced-tomato-steak-plate": + return BreadSliceSlicedTomatoSteakPlate.new(owned_by) + "sliced-tomato-plate": + return SlicedTomatoPlate.new(owned_by) + "sliced-tomato-steak-plate": + return SlicedTomatoSteakPlate.new(owned_by) var t: return GenericItem.new(owned_by, t) diff --git a/client/map/items/bread_slice.gd b/client/map/items/bread_slice.gd new file mode 100644 index 00000000..0449689a --- /dev/null +++ b/client/map/items/bread_slice.gd @@ -0,0 +1,21 @@ +# 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 . +# +class_name BreadSlice +extends Item + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/bread_slice.tscn").instantiate()) diff --git a/client/map/items/bread_slice_plate.gd b/client/map/items/bread_slice_plate.gd new file mode 100644 index 00000000..54a393bc --- /dev/null +++ b/client/map/items/bread_slice_plate.gd @@ -0,0 +1,21 @@ +# 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 . +# +class_name BreadSlicePlate +extends Plate + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/bread_slice.tscn").instantiate()) diff --git a/client/map/items/bread_slice_sliced_tomato_plate.gd b/client/map/items/bread_slice_sliced_tomato_plate.gd new file mode 100644 index 00000000..63e74c21 --- /dev/null +++ b/client/map/items/bread_slice_sliced_tomato_plate.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 . +# +class_name BreadSliceSlicedTomatoPlate +extends BreadSlicePlate + +func _init(owned_by_: Node3D): + super(owned_by_) + var tomato = load("res://map/items/sliced_tomato.tscn").instantiate() + tomato.position.y = .05 + base.add_child(tomato) diff --git a/client/map/items/bread_slice_sliced_tomato_steak_plate.gd b/client/map/items/bread_slice_sliced_tomato_steak_plate.gd new file mode 100644 index 00000000..157c02e9 --- /dev/null +++ b/client/map/items/bread_slice_sliced_tomato_steak_plate.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 . +# +class_name BreadSliceSlicedTomatoSteakPlate +extends BreadSliceSteakPlate + +func _init(owned_by_: Node3D): + super(owned_by_) + var tomato = load("res://map/items/sliced_tomato.tscn").instantiate() + tomato.position.y = .15 + base.add_child(tomato) diff --git a/client/map/items/bread_slice_steak_plate.gd b/client/map/items/bread_slice_steak_plate.gd new file mode 100644 index 00000000..902cdf44 --- /dev/null +++ b/client/map/items/bread_slice_steak_plate.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 . +# +class_name BreadSliceSteakPlate +extends BreadSlicePlate + +func _init(owned_by_: Node3D): + super(owned_by_) + var steak = load("res://map/items/steak.tscn").instantiate() + steak.position.y = .05 + base.add_child(steak) diff --git a/client/map/items/exterior_tree.gd b/client/map/items/exterior_tree.gd deleted file mode 100644 index d1e0b6b3..00000000 --- a/client/map/items/exterior_tree.gd +++ /dev/null @@ -1,24 +0,0 @@ -# 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 . -# -class_name ExteriorTree -extends Grass - -func _init(rename: String, _neighbors: Array): - super(rename, _neighbors) - var random = RandomNumberGenerator.new() - random.seed = rename.hash() - var path = "res://map/tiles/tree_%s.tscn" % random.randi_range(1,5) - base.add_child(load(path).instantiate()) diff --git a/client/map/items/plate.gd b/client/map/items/plate.gd index 91faf0b1..4431a6c8 100644 --- a/client/map/items/plate.gd +++ b/client/map/items/plate.gd @@ -18,7 +18,7 @@ extends Item func _init(owned_by_: Node3D): super(owned_by_) - base.add_child(load("res://map/items/plate.tscn").instantiate()) + add_child(load("res://map/items/plate.tscn").instantiate()) static func base_position() -> Vector3: return Vector3(0., 0.015, 0.) diff --git a/client/map/items/pot.gd b/client/map/items/pot.gd index ac865329..89cbf4c4 100644 --- a/client/map/items/pot.gd +++ b/client/map/items/pot.gd @@ -20,7 +20,7 @@ var steam: CPUParticles3D = load("res://map/items/steam.tscn").instantiate() func _init(owned_by_: Node3D): super(owned_by_) - base.add_child(load("res://map/items/pot.tscn").instantiate()) + add_child(load("res://map/items/pot.tscn").instantiate()) base.add_child(steam) func progress(p: float, warn: bool): diff --git a/client/map/items/slice.gd b/client/map/items/slice.gd deleted file mode 100644 index 0449689a..00000000 --- a/client/map/items/slice.gd +++ /dev/null @@ -1,21 +0,0 @@ -# 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 . -# -class_name BreadSlice -extends Item - -func _init(owned_by_: Node3D): - super(owned_by_) - base.add_child(load("res://map/items/bread_slice.tscn").instantiate()) diff --git a/client/map/items/sliced_tomato_plate.gd b/client/map/items/sliced_tomato_plate.gd new file mode 100644 index 00000000..e8ea2d7b --- /dev/null +++ b/client/map/items/sliced_tomato_plate.gd @@ -0,0 +1,21 @@ +# 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 . +# +class_name SlicedTomatoPlate +extends Plate + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/sliced_tomato.tscn").instantiate()) diff --git a/client/map/items/sliced_tomato_steak_plate.gd b/client/map/items/sliced_tomato_steak_plate.gd new file mode 100644 index 00000000..8dbb9c71 --- /dev/null +++ b/client/map/items/sliced_tomato_steak_plate.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 . +# +class_name SlicedTomatoSteakPlate +extends SteakPlate + +func _init(owned_by_: Node3D): + super(owned_by_) + var tomato = load("res://map/items/sliced_tomato.tscn").instantiate() + tomato.position.y = .1 + base.add_child(tomato) diff --git a/client/map/tiles/exterior_tree.gd b/client/map/tiles/exterior_tree.gd new file mode 100644 index 00000000..d1e0b6b3 --- /dev/null +++ b/client/map/tiles/exterior_tree.gd @@ -0,0 +1,24 @@ +# 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 . +# +class_name ExteriorTree +extends Grass + +func _init(rename: String, _neighbors: Array): + super(rename, _neighbors) + var random = RandomNumberGenerator.new() + random.seed = rename.hash() + var path = "res://map/tiles/tree_%s.tscn" % random.randi_range(1,5) + base.add_child(load(path).instantiate()) -- cgit v1.2.3-70-g09d2 From 86eaa98918760ed829f23a70f15604bf751549be Mon Sep 17 00:00:00 2001 From: tpart Date: Thu, 27 Jun 2024 16:08:44 +0200 Subject: Add grass --- client/game.tscn | 1 + client/map/items/grass.gd | 6 +++--- client/map/tiles/grass.res | Bin 0 -> 2140 bytes client/map/tiles/grass.tscn | 12 +++++++++++ client/map/tiles/grass_generation.gd | 15 ++++++++++++++ client/map/tiles/grass_side.res | Bin 0 -> 1433 bytes client/map/tiles/grass_side.res.depren | Bin 0 -> 1430 bytes client/map/tiles/grass_side.tscn | 10 +++++++++ client/map/tiles/grass_side.webp | Bin 0 -> 46724 bytes client/map/tiles/grass_side.webp.import | 35 ++++++++++++++++++++++++++++++++ 10 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 client/map/tiles/grass.res create mode 100644 client/map/tiles/grass.tscn create mode 100644 client/map/tiles/grass_generation.gd create mode 100644 client/map/tiles/grass_side.res create mode 100644 client/map/tiles/grass_side.res.depren create mode 100644 client/map/tiles/grass_side.tscn create mode 100644 client/map/tiles/grass_side.webp create mode 100644 client/map/tiles/grass_side.webp.import (limited to 'client/map') diff --git a/client/game.tscn b/client/game.tscn index cfbde85b..4165e270 100644 --- a/client/game.tscn +++ b/client/game.tscn @@ -29,6 +29,7 @@ script = ExtResource("6_fbxu8") [node name="FollowCamera" parent="." node_paths=PackedStringArray("target") instance=ExtResource("2_s8y6o")] transform = Transform3D(0.728777, 0.294253, -0.618303, 0, 0.902961, 0.429723, 0.684751, -0.313173, 0.658057, -2.36537, 1.99403, 3.29507) +far = 150.0 target = NodePath("..") [node name="WorldEnvironment" type="WorldEnvironment" parent="."] diff --git a/client/map/items/grass.gd b/client/map/items/grass.gd index 3b8d4016..d303f8c7 100644 --- a/client/map/items/grass.gd +++ b/client/map/items/grass.gd @@ -18,6 +18,6 @@ extends Tile func _init(rename: String, _neighbors: Array): super(rename, _neighbors) - #var grass_tile = load("res://map/tiles/grass.tscn").instantiate() - #grass_tile.position += Vector3(0.5, 0, 0.5) - #add_child(floor_tile) + var grass_tile = load("res://map/tiles/grass.tscn").instantiate() + grass_tile.position += Vector3(0.5, 0, 0.5) + add_child(grass_tile) diff --git a/client/map/tiles/grass.res b/client/map/tiles/grass.res new file mode 100644 index 00000000..1c4565a1 Binary files /dev/null and b/client/map/tiles/grass.res differ diff --git a/client/map/tiles/grass.tscn b/client/map/tiles/grass.tscn new file mode 100644 index 00000000..dd0ef53c --- /dev/null +++ b/client/map/tiles/grass.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=3 format=3 uid="uid://ce14cj7exkvas"] + +[ext_resource type="ArrayMesh" uid="uid://dyu8iuolwqr5l" path="res://map/tiles/grass.res" id="1_pjjrj"] +[ext_resource type="Script" path="res://map/tiles/grass_generation.gd" id="1_u7p1u"] + +[node name="Grass" type="Node3D"] +script = ExtResource("1_u7p1u") + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0) +mesh = ExtResource("1_pjjrj") +skeleton = NodePath("") diff --git a/client/map/tiles/grass_generation.gd b/client/map/tiles/grass_generation.gd new file mode 100644 index 00000000..2031c64a --- /dev/null +++ b/client/map/tiles/grass_generation.gd @@ -0,0 +1,15 @@ +extends Node3D + +const GRASS_COUNT = 16 + +@onready var grass_side = preload("res://map/tiles/grass_side.tscn") + +func _ready(): + var random = RandomNumberGenerator.new() + random.randomize() + + for _i in GRASS_COUNT: + var g: Node3D = grass_side.instantiate() + 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_side.res b/client/map/tiles/grass_side.res new file mode 100644 index 00000000..1e008942 Binary files /dev/null and b/client/map/tiles/grass_side.res differ diff --git a/client/map/tiles/grass_side.res.depren b/client/map/tiles/grass_side.res.depren new file mode 100644 index 00000000..3116171f Binary files /dev/null and b/client/map/tiles/grass_side.res.depren differ diff --git a/client/map/tiles/grass_side.tscn b/client/map/tiles/grass_side.tscn new file mode 100644 index 00000000..cfa7c97a --- /dev/null +++ b/client/map/tiles/grass_side.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://dbp0ts6tfycev"] + +[ext_resource type="ArrayMesh" uid="uid://bxtxpg4lsk613" path="res://map/tiles/grass_side.res" id="1_u044x"] + +[node name="GrassSide" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(0.5, 0, 0, 0, 0.00872619, -0.499924, 0, 0.499924, 0.00872619, 0, 0.25, 0) +mesh = ExtResource("1_u044x") +skeleton = NodePath("") diff --git a/client/map/tiles/grass_side.webp b/client/map/tiles/grass_side.webp new file mode 100644 index 00000000..060d0d53 Binary files /dev/null and b/client/map/tiles/grass_side.webp differ diff --git a/client/map/tiles/grass_side.webp.import b/client/map/tiles/grass_side.webp.import new file mode 100644 index 00000000..5c19b024 --- /dev/null +++ b/client/map/tiles/grass_side.webp.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://p35o0tkyfmrl" +path.s3tc="res://.godot/imported/grass_side.webp-1886940fb35aab66d976c18e081911f4.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://map/tiles/grass_side.webp" +dest_files=["res://.godot/imported/grass_side.webp-1886940fb35aab66d976c18e081911f4.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 -- cgit v1.2.3-70-g09d2