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:
parent
076fdb62c5
commit
41297e5ed4
2 changed files with 7 additions and 6 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue