1
Fork 0
mirror of https://github.com/Steffo99/pineapple-surf.git synced 2024-11-25 01:04:18 +00:00

Fix CropTile behaviour

This commit is contained in:
Steffo 2023-01-08 13:09:34 +01:00
parent 076fdb62c5
commit 41297e5ed4
Signed by: steffo
GPG key ID: 6965406171929D01
2 changed files with 7 additions and 6 deletions

View file

@ -20,21 +20,21 @@ signal on_complete()
func plant():
if growth_timer.is_stopped():
growth_timer.start()
producer.produce_with_random_force()
emit_signal("on_planted")
func complete():
if not growth_timer.is_stopped():
growth_timer.stop()
pop_sound.play_with_random_pitch()
emit_signal("on_complete")
pop_sound.play_with_random_pitch()
producer.produce_with_random_force()
emit_signal("on_complete")
if debug_growth:
plant()
func _process(_delta):
var scale_factor = 1 - (growth_timer.time_left / growth_timer.wait_time)
var scale_factor = 0
if not growth_timer.is_stopped():
scale_factor = 1 - (growth_timer.time_left / growth_timer.wait_time)
sprout_mesh.scale = Vector3(scale_factor, scale_factor, scale_factor)

View file

@ -44,6 +44,7 @@ skeleton = NodePath("../../..")
[node name="GrowthTimer" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
[node name="Pop" type="AudioStreamPlayer3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.1, 0.5)