So i have a game that ends when we got hitted by a creature and a video playing in the background of the game with a timer-node but when the game ends video get stuck in the last image and dont reset when the game start again, i dont have any script related to the videoplayer
this is the script of the main
func game_over():
$ScoreTimer.stop()
$MobTimer.stop()
$HUD.show_game_over()
$Music.stop()
$DeathSound.play()
$gg.play()
func new_game():
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()
$HUD.update_score(score)
$HUD.show_message("Get Ready")
$Music.play()
$GetReadyy.play()
pass
func _on_MobTimer_timeout():
$MobPath/MobSpawnLocation.set_offset(randi())
var mob = Mob.instance()
add_child(mob)
var direction = $MobPath/MobSpawnLocation.rotation + PI/2
mob.position = $MobPath/MobSpawnLocation.position
direction += rand_range (-PI/4, PI/4)
mob.rotation = direction
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED, mob.MAX_SPEED)
,0).rotated(direction))
func _on_ScoreTimer_timeout():
score +=1
$HUD.update_score(score)
pass
func _on_StartTimer_timeout():
$MobTimer.start()
$ScoreTimer.start()