20 lines
444 B
GDScript3
20 lines
444 B
GDScript3
|
extends Spatial
|
||
|
|
||
|
func madness():
|
||
|
$CanvasLayer/ColorRect.visible = false
|
||
|
$CanvasLayer/ColorRect2.visible = true
|
||
|
$CanvasLayer/ColorRect2/AudioStreamPlayer.play()
|
||
|
yield($CanvasLayer/ColorRect2/AudioStreamPlayer, "finished")
|
||
|
$CanvasLayer/ColorRect.visible = true
|
||
|
$CanvasLayer/ColorRect2.visible = false
|
||
|
|
||
|
|
||
|
export var frequency = 600
|
||
|
var seconds = 0.0
|
||
|
|
||
|
func _process(delta):
|
||
|
seconds += delta
|
||
|
if seconds > frequency:
|
||
|
seconds = 0
|
||
|
madness()
|