Skip to main content
added 36 characters in body
Source Link
Progs
  • 95
  • 10

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

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.

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

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

Source Link
Progs
  • 95
  • 10

Godot doesn't loop the sound

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.

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