From 8f7b0f1f936aab717f1d432ed329b9cdfd9ef6fb Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 15:04:30 +0200 Subject: Fix error message about music node --- client/audio/sound.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/audio/sound.gd b/client/audio/sound.gd index 90f1ef1e..ea39050a 100644 --- a/client/audio/sound.gd +++ b/client/audio/sound.gd @@ -29,7 +29,7 @@ func play_music(music : String): # If music == "stop", this stops all music for stream in music_node.get_children(): stream.stop() - if music_node.get_node(music) == null: + if music_node.get_node_or_null(music) == null: return else: music_node.get_node(music).play() -- cgit v1.2.3-70-g09d2 From abfed1358bb04e09117caee91b48925a6c84fa11 Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 15:04:52 +0200 Subject: Fix: Player node name can not be empty --- client/player/player.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/player/player.gd b/client/player/player.gd index 254ec020..117ee76c 100644 --- a/client/player/player.gd +++ b/client/player/player.gd @@ -54,7 +54,8 @@ func _init(_id: int, new_name: String, pos: Vector2, new_character_idx: int, new movement_base.add_child(character) position_ = pos position_anim = pos - name = new_name + if new_name != "": + name = new_name game = new_game username = new_name -- cgit v1.2.3-70-g09d2 From 04c7e6530a5afcb2b181d8870e9132cae20a3ae9 Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 15:28:44 +0200 Subject: Add item progress bars (#44) --- client/player/item_bubble.gd | 15 ++++++++++--- client/player/item_bubble.tscn | 48 +++++++++++++++++++++++++++++------------- client/player/player.gd | 4 ++-- 3 files changed, 47 insertions(+), 20 deletions(-) (limited to 'client') diff --git a/client/player/item_bubble.gd b/client/player/item_bubble.gd index b5dd7352..5a013053 100644 --- a/client/player/item_bubble.gd +++ b/client/player/item_bubble.gd @@ -18,14 +18,21 @@ extends MeshInstance3D signal submit_message -@onready var base: Node3D = $SubViewport/ItemMessage/SubViewportContainer/SubViewport/ItemBase +@onready var base: Node3D = $SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport/ItemBase +@onready var progress: ProgressBar = $SubViewport/ItemMessage/VBoxContainer/ProgressBar var item: Item -func set_item(t: String): +var timeout_remaining := 0. + +func set_item(t: String, timeout_initial: float, timeout_remaining_: float): visible = true item = ItemFactory.produce(t, base) base.add_child(item) + + timeout_remaining = timeout_remaining_ + progress.max_value = timeout_initial + progress.value = timeout_remaining func remove_item(): visible = false @@ -33,5 +40,7 @@ func remove_item(): item.queue_free() func _process(delta): - if item != null: + if visible: item.rotation.y += delta * TAU * .05 + timeout_remaining -= delta + progress.value = timeout_remaining diff --git a/client/player/item_bubble.tscn b/client/player/item_bubble.tscn index c6365591..71359670 100644 --- a/client/player/item_bubble.tscn +++ b/client/player/item_bubble.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://cj777mi5nok6c"] +[gd_scene load_steps=9 format=3 uid="uid://cj777mi5nok6c"] [ext_resource type="Script" path="res://player/item_bubble.gd" id="1_84g24"] @@ -27,6 +27,14 @@ ambient_light_source = 2 ambient_light_color = Color(1, 1, 1, 1) ambient_light_energy = 0.5 +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ima0t"] +corner_radius_bottom_right = 32 +corner_radius_bottom_left = 32 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_x1tnr"] +bg_color = Color(0.415945, 0.888786, 0, 1) +corner_radius_bottom_left = 32 + [node name="ItemBubble" type="MeshInstance3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0) visible = false @@ -39,36 +47,46 @@ disable_3d = true transparent_bg = true size = Vector2i(256, 256) -[node name="ItemMessage" type="Panel" parent="SubViewport"] +[node name="ItemMessage" type="PanelContainer" parent="SubViewport"] offset_right = 256.0 offset_bottom = 256.0 +size_flags_vertical = 3 auto_translate = false theme_override_styles/panel = SubResource("StyleBoxFlat_dpele") -[node name="SubViewportContainer" type="SubViewportContainer" parent="SubViewport/ItemMessage"] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 +[node name="VBoxContainer" type="VBoxContainer" parent="SubViewport/ItemMessage"] +layout_mode = 2 +theme_override_constants/separation = 0 + +[node name="SubViewportContainer" type="SubViewportContainer" parent="SubViewport/ItemMessage/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 -[node name="SubViewport" type="SubViewport" parent="SubViewport/ItemMessage/SubViewportContainer"] +[node name="SubViewport" type="SubViewport" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer"] own_world_3d = true transparent_bg = true handle_input_locally = false -size = Vector2i(256, 256) +size = Vector2i(256, 224) render_target_update_mode = 4 -[node name="Camera3D" type="Camera3D" parent="SubViewport/ItemMessage/SubViewportContainer/SubViewport"] +[node name="Camera3D" type="Camera3D" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport"] transform = Transform3D(1, 0, 0, 0, 0.939693, 0.34202, 0, -0.34202, 0.939693, 0, 0.5, 1) projection = 1 size = 0.6 -[node name="ItemBase" type="Node3D" parent="SubViewport/ItemMessage/SubViewportContainer/SubViewport"] +[node name="ItemBase" type="Node3D" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport"] -[node name="DirectionalLight3D" type="DirectionalLight3D" parent="SubViewport/ItemMessage/SubViewportContainer/SubViewport"] +[node name="DirectionalLight3D" type="DirectionalLight3D" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport"] transform = Transform3D(1, 0, 0, 0, 0.173648, 0.984808, 0, -0.984808, 0.173648, 0, 0, 0) -[node name="WorldEnvironment" type="WorldEnvironment" parent="SubViewport/ItemMessage/SubViewportContainer/SubViewport"] +[node name="WorldEnvironment" type="WorldEnvironment" parent="SubViewport/ItemMessage/VBoxContainer/SubViewportContainer/SubViewport"] environment = SubResource("Environment_iyxrx") + +[node name="ProgressBar" type="ProgressBar" parent="SubViewport/ItemMessage/VBoxContainer"] +custom_minimum_size = Vector2(0, 32) +layout_mode = 2 +theme_override_styles/background = SubResource("StyleBoxFlat_ima0t") +theme_override_styles/fill = SubResource("StyleBoxFlat_x1tnr") +step = 0.0 +value = 82.94 +show_percentage = false diff --git a/client/player/player.gd b/client/player/player.gd index 117ee76c..43d7dd7f 100644 --- a/client/player/player.gd +++ b/client/player/player.gd @@ -151,8 +151,8 @@ func clear_message(): chat_bubble.remove_text() effect.clear_effect() -func item_message(item_name: String, _timeout_initial: float, timeout_remaining: float): - item_bubble.set_item(item_name) +func item_message(item_name: String, timeout_initial: float, timeout_remaining: float): + item_bubble.set_item(item_name, timeout_initial, timeout_remaining) clear_timer.start(timeout_remaining) func text_message(m: String, _timeout_initial: float, timeout_remaining: float): -- cgit v1.2.3-70-g09d2 From 2c183e2e645b5fdf0324a9b1baf584c9dc06d268 Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 21:07:02 +0200 Subject: Add item bubble colours --- client/menu/theme/item_bubble_progress_style.tres | 6 ++++++ client/player/item_bubble.gd | 12 ++++++++++-- client/player/item_bubble.tscn | 9 +++------ 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 client/menu/theme/item_bubble_progress_style.tres (limited to 'client') diff --git a/client/menu/theme/item_bubble_progress_style.tres b/client/menu/theme/item_bubble_progress_style.tres new file mode 100644 index 00000000..69543f24 --- /dev/null +++ b/client/menu/theme/item_bubble_progress_style.tres @@ -0,0 +1,6 @@ +[gd_resource type="StyleBoxFlat" format=3 uid="uid://brw8uogdgx2gf"] + +[resource] +resource_local_to_scene = true +bg_color = Color(0.501961, 0, 0, 1) +corner_radius_bottom_left = 32 diff --git a/client/player/item_bubble.gd b/client/player/item_bubble.gd index 5a013053..1b7dbaa5 100644 --- a/client/player/item_bubble.gd +++ b/client/player/item_bubble.gd @@ -22,15 +22,20 @@ signal submit_message @onready var progress: ProgressBar = $SubViewport/ItemMessage/VBoxContainer/ProgressBar var item: Item - var timeout_remaining := 0. +var timeout_initial := 0. +var progress_style = preload("res://menu/theme/item_bubble_progress_style.tres") + +func _init(): + progress_style = progress_style.duplicate() -func set_item(t: String, timeout_initial: float, timeout_remaining_: float): +func set_item(t: String, timeout_initial_: float, timeout_remaining_: float): visible = true item = ItemFactory.produce(t, base) base.add_child(item) timeout_remaining = timeout_remaining_ + timeout_initial = timeout_initial_ progress.max_value = timeout_initial progress.value = timeout_remaining @@ -44,3 +49,6 @@ func _process(delta): item.rotation.y += delta * TAU * .05 timeout_remaining -= delta progress.value = timeout_remaining + var x: float = timeout_remaining / timeout_initial + progress_style.bg_color = Color(min((1-x) * 2, 1), min(x * 2, 1), 0.) + progress.add_theme_stylebox_override("fill", progress_style) diff --git a/client/player/item_bubble.tscn b/client/player/item_bubble.tscn index 71359670..89cd89ad 100644 --- a/client/player/item_bubble.tscn +++ b/client/player/item_bubble.tscn @@ -1,6 +1,7 @@ [gd_scene load_steps=9 format=3 uid="uid://cj777mi5nok6c"] [ext_resource type="Script" path="res://player/item_bubble.gd" id="1_84g24"] +[ext_resource type="StyleBox" uid="uid://brw8uogdgx2gf" path="res://menu/theme/item_bubble_progress_style.tres" id="2_5qt7f"] [sub_resource type="QuadMesh" id="QuadMesh_tlsxo"] @@ -31,10 +32,6 @@ ambient_light_energy = 0.5 corner_radius_bottom_right = 32 corner_radius_bottom_left = 32 -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_x1tnr"] -bg_color = Color(0.415945, 0.888786, 0, 1) -corner_radius_bottom_left = 32 - [node name="ItemBubble" type="MeshInstance3D"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0) visible = false @@ -86,7 +83,7 @@ environment = SubResource("Environment_iyxrx") custom_minimum_size = Vector2(0, 32) layout_mode = 2 theme_override_styles/background = SubResource("StyleBoxFlat_ima0t") -theme_override_styles/fill = SubResource("StyleBoxFlat_x1tnr") +theme_override_styles/fill = ExtResource("2_5qt7f") step = 0.0 -value = 82.94 +value = 100.0 show_percentage = false -- cgit v1.2.3-70-g09d2 From 5e9ad1a714352d8d24c20d62e75fbc06fc0ecc8b Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 21:19:18 +0200 Subject: Fix round corner on bottom right of item bubble progress bar --- client/player/item_bubble.gd | 1 + 1 file changed, 1 insertion(+) (limited to 'client') diff --git a/client/player/item_bubble.gd b/client/player/item_bubble.gd index 1b7dbaa5..927a5299 100644 --- a/client/player/item_bubble.gd +++ b/client/player/item_bubble.gd @@ -51,4 +51,5 @@ func _process(delta): progress.value = timeout_remaining var x: float = timeout_remaining / timeout_initial progress_style.bg_color = Color(min((1-x) * 2, 1), min(x * 2, 1), 0.) + progress_style.corner_radius_bottom_right = max(32.-(1.-x)*320, 0) progress.add_theme_stylebox_override("fill", progress_style) -- cgit v1.2.3-70-g09d2 From 444113ddace8b843c79c7f389c0733b342170877 Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 21:32:35 +0200 Subject: FIx interpolate angle function --- client/global.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/global.gd b/client/global.gd index 647cac32..b2459d74 100644 --- a/client/global.gd +++ b/client/global.gd @@ -350,7 +350,7 @@ static func interpolate_angle(current, target, dt): current = fmod(current, PI * 2) target = fmod(target, PI * 2) if abs(target - current) > PI: - if target < 0: + if target - current < 0: target += PI * 2 else: target -= PI * 2 -- cgit v1.2.3-70-g09d2 From d665bc5d032a18c52f4e06952ff9101f8550ef4f Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 21:50:03 +0200 Subject: Add strawberry model & implement item --- client/map/item_factory.gd | 2 ++ client/map/items/strawberry.gd | 33 +++++++++++++++++++++++++++++++++ client/map/items/strawberry.res | Bin 0 -> 8522 bytes client/map/items/strawberry.tscn | 10 ++++++++++ 4 files changed, 45 insertions(+) create mode 100644 client/map/items/strawberry.gd create mode 100644 client/map/items/strawberry.res create mode 100644 client/map/items/strawberry.tscn (limited to 'client') diff --git a/client/map/item_factory.gd b/client/map/item_factory.gd index 8d768794..39e1e12d 100644 --- a/client/map/item_factory.gd +++ b/client/map/item_factory.gd @@ -108,5 +108,7 @@ static func produce(name: String, owned_by: Node3D) -> Item: return Coconut.new(owned_by) "coconut-foodprocessor": return CoconutFoodProcessor.new(owned_by) + "strawberry": + return Strawberry.new(owned_by) var t: return GenericItem.new(owned_by, t) diff --git a/client/map/items/strawberry.gd b/client/map/items/strawberry.gd new file mode 100644 index 00000000..ef9abb64 --- /dev/null +++ b/client/map/items/strawberry.gd @@ -0,0 +1,33 @@ +# Hurry Curry! - a game about cooking +# 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 . +# +class_name Strawberry +extends Item + +var cut: CPUParticles3D = load("res://map/items/cut.tscn").instantiate() + +func _init(owned_by_: Node3D): + super(owned_by_) + base.add_child(load("res://map/items/strawberry.tscn").instantiate()) + base.add_child(cut) + cut.color = Color(1., 0., 0.) + +func progress(p: float, warn: bool): + super(p, warn) + cut.emitting = true + +func finish(warn: bool): + super(warn) + cut.emitting = false diff --git a/client/map/items/strawberry.res b/client/map/items/strawberry.res new file mode 100644 index 00000000..46a723d1 Binary files /dev/null and b/client/map/items/strawberry.res differ diff --git a/client/map/items/strawberry.tscn b/client/map/items/strawberry.tscn new file mode 100644 index 00000000..24e7be41 --- /dev/null +++ b/client/map/items/strawberry.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://df1xktleeqg3m"] + +[ext_resource type="ArrayMesh" uid="uid://c2uwqjxx7mnqp" path="res://map/items/strawberry.res" id="1_8dx1o"] + +[node name="Strawberry" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(-5.68248e-10, -0.013, 0, -5.68248e-10, 2.48389e-17, -0.013, 0.013, -5.68248e-10, -5.68248e-10, 0, 0.125, 0) +mesh = ExtResource("1_8dx1o") +skeleton = NodePath("") -- cgit v1.2.3-70-g09d2 From 4f1a15ad3acfdd231846ea7d18650eeded88867d Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 21:52:07 +0200 Subject: Fix incorrect node name in fish crate scene --- client/map/tiles/fish_crate.tscn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/map/tiles/fish_crate.tscn b/client/map/tiles/fish_crate.tscn index 91d45f44..a096a000 100644 --- a/client/map/tiles/fish_crate.tscn +++ b/client/map/tiles/fish_crate.tscn @@ -3,7 +3,7 @@ [ext_resource type="PackedScene" uid="uid://xdui0oya4lpb" path="res://map/tiles/crate.tscn" id="1_uotdf"] [ext_resource type="PackedScene" uid="uid://dom5n7h7l7sr8" path="res://map/items/fish.tscn" id="3_p6tbn"] -[node name="LeekCrate" instance=ExtResource("1_uotdf")] +[node name="FishCrate" instance=ExtResource("1_uotdf")] [node name="Fish" parent="." index="1" instance=ExtResource("3_p6tbn")] transform = Transform3D(-0.449443, -0.771467, -0.450378, 0.791587, -0.577595, 0.199436, -0.413994, -0.266878, 0.870279, -0.214561, 0.395904, -0.219162) -- cgit v1.2.3-70-g09d2 From 98c33cfa06732b630522c836d9686243ced891ad Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 16 Aug 2024 21:57:13 +0200 Subject: interp item to next 90° rotation when on tile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/global.gd | 15 +++++++++++---- client/map/items/item.gd | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'client') diff --git a/client/global.gd b/client/global.gd index 647cac32..d660173a 100644 --- a/client/global.gd +++ b/client/global.gd @@ -350,10 +350,17 @@ static func interpolate_angle(current, target, dt): current = fmod(current, PI * 2) target = fmod(target, PI * 2) if abs(target - current) > PI: - if target < 0: - target += PI * 2 - else: - target -= PI * 2 + if target < 0: target += PI * 2 + else: target -= PI * 2 + return target + (current - target) * exp(-dt) + +# TODO not working in all cases yet but there was an attempt +static func interpolate_angle_closest_quarter(current, target, dt): + current = fmod(current, PI * 2) + target = fmod(target, PI * 2) + while abs(target - current) > PI / 4.: + if target - current < 0: target += PI / 2 + else: target -= PI / 2 return target + (current - target) * exp(-dt) func find_menu(node: Node) -> Menu: diff --git a/client/map/items/item.gd b/client/map/items/item.gd index fc10dbee..2d046700 100644 --- a/client/map/items/item.gd +++ b/client/map/items/item.gd @@ -44,9 +44,11 @@ func _ready(): position = owned_by.global_position func _process(delta): - var ispeed = 30.0 if owned_by.get_parent().get_parent() is Player else 10. + var p = owned_by.get_parent().get_parent() is Player + var ispeed = 30.0 if p else 10. position = G.interpolate(position, owned_by.global_position, delta * ispeed) - rotation.y = G.interpolate_angle(rotation.y, owned_by.global_rotation.y, delta * ispeed) + if p: rotation.y = G.interpolate_angle(rotation.y, owned_by.global_rotation.y, delta * ispeed) + else: rotation.y = G.interpolate_angle_closest_quarter(rotation.y, owned_by.global_rotation.y, delta * ispeed) func progress(p: float, warn: bool): progress_instance.visible = true -- cgit v1.2.3-70-g09d2 From 1b7aad1747b69b369ee646399b49e44c5f250124 Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 22:00:37 +0200 Subject: Add strawberry crate model & implement item --- client/map/tile_factory.gd | 2 ++ client/map/tiles/strawberry_crate.gd | 21 +++++++++++++++++++++ client/map/tiles/strawberry_crate.tscn | 21 +++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 client/map/tiles/strawberry_crate.gd create mode 100644 client/map/tiles/strawberry_crate.tscn (limited to 'client') diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd index a0dd2dca..06f1c1fa 100644 --- a/client/map/tile_factory.gd +++ b/client/map/tile_factory.gd @@ -86,6 +86,8 @@ static func produce(tile_name: String, node_name: String, neighbors: Array) -> T return Street.new(node_name, neighbors) "rice-crate": return RiceCrate.new(node_name, neighbors) + "strawberry-crate": + return StrawberryCrate.new(node_name, neighbors) var t: push_warning("tile %s unknown" % t) return GenericTile.new(node_name, neighbors, t) diff --git a/client/map/tiles/strawberry_crate.gd b/client/map/tiles/strawberry_crate.gd new file mode 100644 index 00000000..6a236af4 --- /dev/null +++ b/client/map/tiles/strawberry_crate.gd @@ -0,0 +1,21 @@ +# Hurry Curry! - a game about cooking +# 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 . +# +class_name StrawberryCrate +extends Crate + +func _init(rename: String, neighbors: Array): + super(rename, neighbors) + base.add_child(load("res://map/tiles/strawberry_crate.tscn").instantiate()) diff --git a/client/map/tiles/strawberry_crate.tscn b/client/map/tiles/strawberry_crate.tscn new file mode 100644 index 00000000..070323b6 --- /dev/null +++ b/client/map/tiles/strawberry_crate.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=3 format=3 uid="uid://disox718eydry"] + +[ext_resource type="PackedScene" uid="uid://xdui0oya4lpb" path="res://map/tiles/crate.tscn" id="1_j8iml"] +[ext_resource type="PackedScene" uid="uid://df1xktleeqg3m" path="res://map/items/strawberry.tscn" id="3_pv4co"] + +[node name="StrawberryCrate" instance=ExtResource("1_j8iml")] + +[node name="Strawberry" parent="." index="1" instance=ExtResource("3_pv4co")] +transform = Transform3D(0.450462, -0.749695, 0.48481, 0.857167, 0.515038, 0, -0.249695, 0.415563, 0.87462, 0.280431, 0.2, -0.249977) + +[node name="Strawberry2" parent="." index="2" instance=ExtResource("3_pv4co")] +transform = Transform3D(0.514594, -0.856429, -0.0415094, 0.857167, 0.515038, 0, 0.0213789, -0.0355805, 0.999138, 0.304305, 0.2, 0.224393) + +[node name="Strawberry3" parent="." index="3" instance=ExtResource("3_pv4co")] +transform = Transform3D(0.333174, -0.941988, -0.0406744, 0.942623, 0.333757, -0.00828417, 0.0213789, -0.0355805, 0.999138, 0.0704219, 0.2, 0.0109546) + +[node name="Strawberry4" parent="." index="4" instance=ExtResource("3_pv4co")] +transform = Transform3D(-0.06674, -0.173859, -0.982506, 0.976472, -0.213751, -0.0285059, -0.205055, -0.961293, 0.184035, -0.181014, 0.232884, -0.103933) + +[node name="Strawberry5" parent="." index="5" instance=ExtResource("3_pv4co")] +transform = Transform3D(-0.0250969, -0.243938, 0.969466, 0.976472, -0.213751, -0.0285059, 0.214178, 0.945941, 0.243563, -0.181014, 0.232884, 0.0976371) -- cgit v1.2.3-70-g09d2 From d1b80432f13b6ff373c9a727373e432929c2155f Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 22:11:44 +0200 Subject: Add flour crate model to replace unsuitable flour counter and improve consistency & implement item --- client/map/tile_factory.gd | 2 +- client/map/tiles/flour_counter.gd | 26 -------------------------- client/map/tiles/flour_crate.gd | 21 +++++++++++++++++++++ client/map/tiles/flour_crate.tscn | 24 ++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 27 deletions(-) delete mode 100644 client/map/tiles/flour_counter.gd create mode 100644 client/map/tiles/flour_crate.gd create mode 100644 client/map/tiles/flour_crate.tscn (limited to 'client') diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd index 06f1c1fa..4a8a1d7d 100644 --- a/client/map/tile_factory.gd +++ b/client/map/tile_factory.gd @@ -27,7 +27,7 @@ static func produce(tile_name: String, node_name: String, neighbors: Array) -> T "counter": return CounterBase.new(node_name, neighbors) "flour-crate": - return FlourCounter.new(node_name, neighbors) + return FlourCrate.new(node_name, neighbors) "fish-crate": return FishCrate.new(node_name, neighbors) "oven": diff --git a/client/map/tiles/flour_counter.gd b/client/map/tiles/flour_counter.gd deleted file mode 100644 index 03bb7742..00000000 --- a/client/map/tiles/flour_counter.gd +++ /dev/null @@ -1,26 +0,0 @@ -# Hurry Curry! - 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 FlourCounter -extends CounterBase - -func _init(rename: String, neighbors: Array): - super(rename, neighbors) - var bag = load("res://map/items/flour.tscn").instantiate() - # this is supposed to be overridden - @warning_ignore("static_called_on_instance") - bag.position = interact_target() - bag.rotation_degrees.y = 45 - base.add_child(bag) diff --git a/client/map/tiles/flour_crate.gd b/client/map/tiles/flour_crate.gd new file mode 100644 index 00000000..4949e646 --- /dev/null +++ b/client/map/tiles/flour_crate.gd @@ -0,0 +1,21 @@ +# Hurry Curry! - a game about cooking +# 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 . +# +class_name FlourCrate +extends Crate + +func _init(rename: String, neighbors: Array): + super(rename, neighbors) + base.add_child(load("res://map/tiles/flour_crate.tscn").instantiate()) diff --git a/client/map/tiles/flour_crate.tscn b/client/map/tiles/flour_crate.tscn new file mode 100644 index 00000000..8f3dde0e --- /dev/null +++ b/client/map/tiles/flour_crate.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=3 format=3 uid="uid://qwk6nih458mh"] + +[ext_resource type="PackedScene" uid="uid://xdui0oya4lpb" path="res://map/tiles/crate.tscn" id="1_7xctt"] +[ext_resource type="PackedScene" uid="uid://dgo8cknr1o6ml" path="res://map/items/flour.tscn" id="2_i5ha0"] + +[node name="FlourCrate" instance=ExtResource("1_7xctt")] + +[node name="Flour" parent="." index="1" instance=ExtResource("2_i5ha0")] +transform = Transform3D(0.990268, 0, -0.139173, 0, 1, 0, 0.139173, 0, 0.990268, 0.25, 0, -0.2) + +[node name="Flour2" parent="." index="2" instance=ExtResource("2_i5ha0")] +transform = Transform3D(0.990268, 0, 0.139173, 0, 1, 0, -0.139173, 0, 0.990268, 0.25, 0, 0.2) + +[node name="Flour3" parent="." index="3" instance=ExtResource("2_i5ha0")] +transform = Transform3D(-0.0965059, 0, 0.995332, -0.436731, 0.898595, -0.0423448, -0.894401, -0.438779, -0.0867198, 0, 0, -0.146685) + +[node name="Flour4" parent="." index="4" instance=ExtResource("2_i5ha0")] +transform = Transform3D(0.99525, -0.00903298, -0.0969282, -0.0219365, 0.949266, -0.313707, 0.0948444, 0.314343, 0.94456, 0, 0, 0.106343) + +[node name="Flour5" parent="." index="5" instance=ExtResource("2_i5ha0")] +transform = Transform3D(0.990268, 0, -0.139173, 0, 1, 0, 0.139173, 0, 0.990268, -0.25, 0, -0.2) + +[node name="Flour6" parent="." index="6" instance=ExtResource("2_i5ha0")] +transform = Transform3D(0.997564, 0, 0.0697565, 0, 1, 0, -0.0697565, 0, 0.997564, -0.25, 0, 0.2) -- cgit v1.2.3-70-g09d2 From c85883c649e4503fe0840156f56170787d6627b0 Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 22:13:21 +0200 Subject: Make flour crate model more visually appealing --- client/map/tiles/flour_crate.tscn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/map/tiles/flour_crate.tscn b/client/map/tiles/flour_crate.tscn index 8f3dde0e..1e4a7b7d 100644 --- a/client/map/tiles/flour_crate.tscn +++ b/client/map/tiles/flour_crate.tscn @@ -12,7 +12,7 @@ transform = Transform3D(0.990268, 0, -0.139173, 0, 1, 0, 0.139173, 0, 0.990268, transform = Transform3D(0.990268, 0, 0.139173, 0, 1, 0, -0.139173, 0, 0.990268, 0.25, 0, 0.2) [node name="Flour3" parent="." index="3" instance=ExtResource("2_i5ha0")] -transform = Transform3D(-0.0965059, 0, 0.995332, -0.436731, 0.898595, -0.0423448, -0.894401, -0.438779, -0.0867198, 0, 0, -0.146685) +transform = Transform3D(0.973674, 0, 0.227943, 0, 1, 0, -0.227943, 0, 0.973674, 0, 0, -0.202263) [node name="Flour4" parent="." index="4" instance=ExtResource("2_i5ha0")] transform = Transform3D(0.99525, -0.00903298, -0.0969282, -0.0219365, 0.949266, -0.313707, 0.0948444, 0.314343, 0.94456, 0, 0, 0.106343) -- cgit v1.2.3-70-g09d2 From f08fbd2fc0da6605823ca81bc04e9dfbd10d195d Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 22:24:48 +0200 Subject: Add coconut crate model & implement item --- client/map/tile_factory.gd | 2 ++ client/map/tiles/coconut_crate.gd | 21 +++++++++++++++++++++ client/map/tiles/coconut_crate.tscn | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 client/map/tiles/coconut_crate.gd create mode 100644 client/map/tiles/coconut_crate.tscn (limited to 'client') diff --git a/client/map/tile_factory.gd b/client/map/tile_factory.gd index 4a8a1d7d..bd0a71ca 100644 --- a/client/map/tile_factory.gd +++ b/client/map/tile_factory.gd @@ -88,6 +88,8 @@ static func produce(tile_name: String, node_name: String, neighbors: Array) -> T return RiceCrate.new(node_name, neighbors) "strawberry-crate": return StrawberryCrate.new(node_name, neighbors) + "coconut-crate": + return CoconutCrate.new(node_name, neighbors) var t: push_warning("tile %s unknown" % t) return GenericTile.new(node_name, neighbors, t) diff --git a/client/map/tiles/coconut_crate.gd b/client/map/tiles/coconut_crate.gd new file mode 100644 index 00000000..55ef16d5 --- /dev/null +++ b/client/map/tiles/coconut_crate.gd @@ -0,0 +1,21 @@ +# Hurry Curry! - a game about cooking +# 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 . +# +class_name CoconutCrate +extends Crate + +func _init(rename: String, neighbors: Array): + super(rename, neighbors) + base.add_child(load("res://map/tiles/coconut_crate.tscn").instantiate()) diff --git a/client/map/tiles/coconut_crate.tscn b/client/map/tiles/coconut_crate.tscn new file mode 100644 index 00000000..af2146b1 --- /dev/null +++ b/client/map/tiles/coconut_crate.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=3 format=3 uid="uid://cti8difugwnxm"] + +[ext_resource type="PackedScene" uid="uid://xdui0oya4lpb" path="res://map/tiles/crate.tscn" id="1_1qpmd"] +[ext_resource type="PackedScene" uid="uid://cmsirxgv7iqnk" path="res://map/items/coconut.tscn" id="3_s5fgf"] + +[node name="StrawberryCrate" instance=ExtResource("1_1qpmd")] + +[node name="Coconut" parent="." index="1" instance=ExtResource("3_s5fgf")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.177501, 0, -0.17735) + +[node name="Coconut2" parent="." index="2" instance=ExtResource("3_s5fgf")] +transform = Transform3D(0.735258, 0, 0.677788, 0, 1, 0, -0.677788, 0, 0.735258, 0.185726, 0, -0.192698) + +[node name="Coconut3" parent="." index="3" instance=ExtResource("3_s5fgf")] +transform = Transform3D(0.835347, 0, -0.549723, 0, 1, 0, 0.549723, 0, 0.835347, -0.177501, 0, 0.17735) + +[node name="Coconut4" parent="." index="4" instance=ExtResource("3_s5fgf")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.184021, 0, 0.17735) -- cgit v1.2.3-70-g09d2 From c08bebd1db640118e0fb6e5e214b81b4beff53df Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 23:09:44 +0200 Subject: Replace strawberry model with smooth model with correct faces --- client/map/items/strawberry.res | Bin 8522 -> 11074 bytes client/map/items/strawberry.tscn | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/map/items/strawberry.res b/client/map/items/strawberry.res index 46a723d1..60da68ed 100644 Binary files a/client/map/items/strawberry.res and b/client/map/items/strawberry.res differ diff --git a/client/map/items/strawberry.tscn b/client/map/items/strawberry.tscn index 24e7be41..90df0c3c 100644 --- a/client/map/items/strawberry.tscn +++ b/client/map/items/strawberry.tscn @@ -5,6 +5,6 @@ [node name="Strawberry" type="Node3D"] [node name="Mesh" type="MeshInstance3D" parent="."] -transform = Transform3D(-5.68248e-10, -0.013, 0, -5.68248e-10, 2.48389e-17, -0.013, 0.013, -5.68248e-10, -5.68248e-10, 0, 0.125, 0) +transform = Transform3D(-5.68248e-10, 1.1365e-09, 0.013, 0, -0.013, 1.1365e-09, 0.013, 4.96778e-17, 5.68248e-10, 0, 0.125, 0) mesh = ExtResource("1_8dx1o") skeleton = NodePath("") -- cgit v1.2.3-70-g09d2 From ea865588146c1b2cff68f10999be342ce35d7a32 Mon Sep 17 00:00:00 2001 From: tpart Date: Fri, 16 Aug 2024 23:17:03 +0200 Subject: Make stars particles in rating menu more visible --- client/menu/rating/rating.tscn | 72 +++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'client') diff --git a/client/menu/rating/rating.tscn b/client/menu/rating/rating.tscn index 30dc2cd2..b12d1470 100644 --- a/client/menu/rating/rating.tscn +++ b/client/menu/rating/rating.tscn @@ -7,14 +7,6 @@ [ext_resource type="Material" uid="uid://beea1pc5nt67r" path="res://menu/theme/dark_blur_material.tres" id="4_hdurb"] [ext_resource type="AudioStream" uid="uid://camy77x26mmpv" path="res://menu/sounds/success.ogg" id="5_tutpj"] -[sub_resource type="Curve" id="Curve_dqga7"] -_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.0954774, 1), 0.262418, 0.0, 0, 0] -point_count = 2 - -[sub_resource type="Gradient" id="Gradient_majwe"] -offsets = PackedFloat32Array(0, 0.0584795, 1) -colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0) - [sub_resource type="ShaderMaterial" id="ShaderMaterial_oi7xd"] shader = ExtResource("1_pddsm") shader_parameter/t = 0.0 @@ -27,6 +19,14 @@ shader_parameter/t = 0.0 shader = ExtResource("1_pddsm") shader_parameter/t = 0.0 +[sub_resource type="Curve" id="Curve_dqga7"] +_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.0954774, 1), 0.262418, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Gradient" id="Gradient_majwe"] +offsets = PackedFloat32Array(0, 0.0584795, 1) +colors = PackedColorArray(1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0) + [node name="Rating" type="Control"] layout_mode = 3 anchors_preset = 15 @@ -38,34 +38,6 @@ theme = ExtResource("1_uwajf") script = ExtResource("2_cq0se") support_anim = false -[node name="Control" type="Control" parent="."] -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="Particles" type="CPUParticles2D" parent="Control"] -emitting = false -amount = 32 -texture = ExtResource("1_7qv7r") -emission_shape = 3 -emission_rect_extents = Vector2(512, 256) -direction = Vector2(0, -1) -initial_velocity_min = 256.0 -initial_velocity_max = 256.0 -angular_velocity_min = -30.0 -angular_velocity_max = 30.0 -angle_min = -20.0 -angle_max = 20.0 -scale_amount_min = 0.1 -scale_amount_max = 0.2 -scale_amount_curve = SubResource("Curve_dqga7") -color_ramp = SubResource("Gradient_majwe") - [node name="MarginContainer" type="MarginContainer" parent="."] layout_mode = 1 anchors_preset = 15 @@ -154,4 +126,32 @@ text = "Accept" wait_time = 0.5 one_shot = true +[node name="Control" type="Control" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Particles" type="CPUParticles2D" parent="Control"] +emitting = false +amount = 32 +texture = ExtResource("1_7qv7r") +emission_shape = 3 +emission_rect_extents = Vector2(512, 256) +direction = Vector2(0, -1) +initial_velocity_min = 256.0 +initial_velocity_max = 256.0 +angular_velocity_min = -30.0 +angular_velocity_max = 30.0 +angle_min = -20.0 +angle_max = 20.0 +scale_amount_min = 0.1 +scale_amount_max = 0.2 +scale_amount_curve = SubResource("Curve_dqga7") +color_ramp = SubResource("Gradient_majwe") + [connection signal="pressed" from="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer/Close" to="." method="_on_close_pressed"] -- cgit v1.2.3-70-g09d2 From 9970aa8f43c4df5a4b7c6df938b889f842666189 Mon Sep 17 00:00:00 2001 From: tpart Date: Sat, 17 Aug 2024 14:15:43 +0200 Subject: Add new models to credits list --- client/menu/credits.gd | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client') diff --git a/client/menu/credits.gd b/client/menu/credits.gd index 030ccd06..c82fbc60 100644 --- a/client/menu/credits.gd +++ b/client/menu/credits.gd @@ -25,6 +25,8 @@ var credits := [ [tr("Models"), [ ["kenney.nl", "Various Models", cc0], ["Kay Lousberg", "Kitchen tiles", cc0], + ["Poly by Google", "Strawberry", cc_by_3], + ["Poly by Google", "Fish", cc_by_3] ]], [tr("Sounds"), [ ["Dryoma", "Footstep sounds", cc_by_4], -- cgit v1.2.3-70-g09d2 From de807e8cd2186286e235808ec1fc1f753e7748f4 Mon Sep 17 00:00:00 2001 From: tpart Date: Sat, 17 Aug 2024 15:50:45 +0200 Subject: Don't create bubble if timeout remaining is 0 --- client/player/item_bubble.gd | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'client') diff --git a/client/player/item_bubble.gd b/client/player/item_bubble.gd index 927a5299..626fb7b6 100644 --- a/client/player/item_bubble.gd +++ b/client/player/item_bubble.gd @@ -30,6 +30,10 @@ func _init(): progress_style = progress_style.duplicate() func set_item(t: String, timeout_initial_: float, timeout_remaining_: float): + if timeout_remaining_ == 0.: + remove_item() + return + visible = true item = ItemFactory.produce(t, base) base.add_child(item) -- cgit v1.2.3-70-g09d2