Improves sand VFX.
This commit is contained in:
@@ -247,9 +247,9 @@ sprites = [NodePath("AnimatedSprite2D")]
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Body/SpriteControl"]
|
||||
unique_name_in_owner = true
|
||||
sprite_frames = SubResource("SpriteFrames_g5q5i")
|
||||
animation = &"idle2"
|
||||
animation = &"idle1"
|
||||
autoplay = "idle1"
|
||||
frame_progress = 0.302072
|
||||
frame_progress = 0.236195
|
||||
centered = false
|
||||
offset = Vector2(-5, 0)
|
||||
|
||||
|
||||
@@ -52,14 +52,13 @@ func spawn_crab(stimulus: Dictionary) -> void:
|
||||
return
|
||||
|
||||
# The crab disappears in the hole
|
||||
sand_vfx.start()
|
||||
crab_audio_stream_player.start_playing()
|
||||
tween = create_tween()
|
||||
tween.tween_property(crab, "position", Vector2(crab_x, 100.0), 0.5)
|
||||
if await is_button_pressed_with_limit(tween.finished):
|
||||
return
|
||||
sand_vfx.play()
|
||||
crab_audio_stream_player.stop_playing()
|
||||
sand_vfx.stop()
|
||||
|
||||
crab.queue_free()
|
||||
crab = null
|
||||
@@ -104,6 +103,7 @@ func _on_crab_hit(stimulus: Dictionary) -> void:
|
||||
tween = create_tween()
|
||||
tween.tween_property(crab, "position", Vector2(crab_x, 100.0), 0.5)
|
||||
await tween.finished
|
||||
sand_vfx.play()
|
||||
|
||||
# No idea what this does
|
||||
if not timer.is_stopped():
|
||||
|
||||
@@ -20,6 +20,12 @@ func _ready():
|
||||
timer.wait_time = particles.lifetime
|
||||
|
||||
|
||||
func play():
|
||||
particles.texture = textures.pick_random()
|
||||
particles.amount = randi_range(6, 18)
|
||||
particles.restart()
|
||||
|
||||
|
||||
func start():
|
||||
_on_timer_timeout()
|
||||
|
||||
@@ -29,7 +35,5 @@ func stop():
|
||||
|
||||
|
||||
func _on_timer_timeout():
|
||||
particles.texture = textures.pick_random()
|
||||
particles.amount = randi_range(6, 18)
|
||||
particles.restart()
|
||||
play()
|
||||
timer.start()
|
||||
|
||||
Reference in New Issue
Block a user