meat_madness_redux/godot/effects/grainy_shader.gd

20 lines
444 B
GDScript

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()