1
\$\begingroup\$

Basically it's the sound of a fuse for a bomb, until the timer sends the signal the sound should stop playing and play the explosion sound, but right now only plays once and the stop.

What i did wrong/ what i did missed?

the code i use for the bomb scene:

extends StaticBody2D

func _ready():
    $AnimatedSprite.animation = "bomb"
    $CollisionShape2D.disabled = true
    $BombTimer.start()
    $FuseSound.play()

func _on_BombTimer_timeout():
    $AnimatedSprite.animation = "explosion"
    $CollisionShape2D.disabled = false
    $RemoveTimer.start()
    $ExplosionSound.play()

func _on_RemoveTimer_timeout():
    queue_free()

func _on_Bomb_body_entered(body):
    print("bomb collided with:" + body.get_name())

enter image description here enter image description here

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Did you click the "Reimport" button after checking "Loop" in the import dock? Also, I'm not sure if you should touch "Loop End" manually in the inspector. \$\endgroup\$ Commented Jun 22, 2020 at 7:31
  • \$\begingroup\$ if i let "loop end" with 0, no sound can be heard when playing the game \$\endgroup\$ Commented Jun 22, 2020 at 20:57
  • \$\begingroup\$ Can you try $ExplosionSound.stream.set_loop(true) in the _ready function ? \$\endgroup\$ Commented Apr 20, 2022 at 4:50

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.