aboutsummaryrefslogtreecommitdiff
path: root/client/map/items
diff options
context:
space:
mode:
authornokoe <nokoe@mailbox.org>2025-09-29 23:57:44 +0200
committernokoe <nokoe@mailbox.org>2025-09-29 23:59:01 +0200
commit4d883a67ef81ef9428e39734664430724668077f (patch)
treedc453df04c6f987326ea386e618b8886df99897c /client/map/items
parent9d2966c97b0022d48baf4d95d12926be9dc5750c (diff)
downloadhurrycurry-4d883a67ef81ef9428e39734664430724668077f.tar
hurrycurry-4d883a67ef81ef9428e39734664430724668077f.tar.bz2
hurrycurry-4d883a67ef81ef9428e39734664430724668077f.tar.zst
use deep fryer basket; persist item rotation on counters
Diffstat (limited to 'client/map/items')
-rw-r--r--client/map/items/basket.gd7
-rw-r--r--client/map/items/basket.tscn2
-rw-r--r--client/map/items/deep_frying.tscn26
-rw-r--r--client/map/items/item.gd9
4 files changed, 38 insertions, 6 deletions
diff --git a/client/map/items/basket.gd b/client/map/items/basket.gd
index 459d6b81..d90ab25e 100644
--- a/client/map/items/basket.gd
+++ b/client/map/items/basket.gd
@@ -17,12 +17,15 @@ class_name Basket
extends Item
var steam: CPUParticles3D = load("res://map/items/steam.tscn").instantiate()
+var bubbles: CPUParticles3D = load("res://map/items/deep_frying.tscn").instantiate()
func _init(owned_by_: Node3D, contents: Array):
super(owned_by_)
add_child(load("res://map/items/basket.tscn").instantiate())
base.add_child(steam)
-
+ base.add_child(bubbles)
+ base.position.y = .15
+
for i in contents:
match i:
_:
@@ -31,6 +34,7 @@ func _init(owned_by_: Node3D, contents: Array):
func progress(position_: float, speed: float, warn: bool):
super(position_, speed, warn)
steam.emitting = true
+ bubbles.emitting = true
if warn:
steam.color = Color(.2, .2, .2)
else:
@@ -39,6 +43,7 @@ func progress(position_: float, speed: float, warn: bool):
func finish():
super()
steam.emitting = false
+ bubbles.emitting = false
static func base_position() -> Vector3:
return Vector3(0.,0.015, 0.)
diff --git a/client/map/items/basket.tscn b/client/map/items/basket.tscn
index c6f92a50..2fcd336d 100644
--- a/client/map/items/basket.tscn
+++ b/client/map/items/basket.tscn
@@ -5,5 +5,5 @@
[node name="Basket" type="Node3D"]
[node name="Mesh" type="MeshInstance3D" parent="."]
-transform = Transform3D(0.75, 0, 0, 0, 0.75, 0, 0, 0, 0.75, 0, 0, 0)
+transform = Transform3D(-0.75, 0, -6.556708e-08, 0, 0.75, 0, 6.556708e-08, 0, -0.75, 0, 0, 0)
mesh = ExtResource("1_7yj46")
diff --git a/client/map/items/deep_frying.tscn b/client/map/items/deep_frying.tscn
new file mode 100644
index 00000000..81a4ccfb
--- /dev/null
+++ b/client/map/items/deep_frying.tscn
@@ -0,0 +1,26 @@
+[gd_scene load_steps=3 format=3 uid="uid://c2g5ncvn45263"]
+
+[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_3xkdk"]
+albedo_color = Color(0.9153118, 0.62961817, 0.44200557, 1)
+roughness = 0.0
+
+[sub_resource type="SphereMesh" id="SphereMesh_iygiy"]
+material = SubResource("StandardMaterial3D_3xkdk")
+radius = 0.1
+height = 0.2
+
+[node name="DeepFrying" type="CPUParticles3D"]
+emitting = false
+mesh = SubResource("SphereMesh_iygiy")
+emission_shape = 6
+emission_ring_axis = Vector3(0, 1, 0)
+emission_ring_height = 0.1
+emission_ring_radius = 0.1
+emission_ring_inner_radius = 0.05
+emission_ring_cone_angle = 90.0
+direction = Vector3(0, 1, 0)
+gravity = Vector3(0, -1, 0)
+initial_velocity_min = 0.2
+initial_velocity_max = 0.4
+scale_amount_min = 0.2
+scale_amount_max = 0.5
diff --git a/client/map/items/item.gd b/client/map/items/item.gd
index bf61966f..ea5b3937 100644
--- a/client/map/items/item.gd
+++ b/client/map/items/item.gd
@@ -20,6 +20,8 @@ const CHECKMARK: PackedScene = preload("uid://bdbw8whs3data")
var owned_by: Node3D
var base: Node3D = Node3D.new()
+var rotation_target: float = 0.
+var position_target: Vector3 = Vector3(0., 0., 0.)
var progress_instance: Progress3D = preload("res://map/progress/progress.tscn").instantiate()
var take_sound: PlayRandom = preload("res://audio/play_random.tscn").instantiate()
@@ -63,12 +65,11 @@ func _process(delta):
var player_owned = owned_by.get_parent().get_parent() is Player
player_owned_timer = player_owned_timer + delta if player_owned else 0.
var anim_speed = 10.0 * exp(player_owned_timer * 3.0) # infinity is fine. G.interpolate can handle it
- position = G.interpolate(position, owned_by.global_position, delta * anim_speed)
- if player_owned: rotation.y = G.interpolate_angle(rotation.y, owned_by.global_rotation.y, delta * anim_speed)
- else: rotation.y = G.interpolate_angle_closest_quarter(rotation.y, owned_by.global_rotation.y, delta * anim_speed)
+ position = G.interpolate(position, position_target, delta * anim_speed)
+ rotation.y = G.interpolate_angle(rotation.y, rotation_target, delta * anim_speed)
if creation_timer != null:
creation_timer += delta * 10.0
- if creation_timer > 1:
+ if creation_timer > 1:
scale = Vector3.ONE
creation_timer = null
else: scale = Vector3.ONE * creation_timer