35 lines
1.1 KiB
GDScript
35 lines
1.1 KiB
GDScript
extends SubViewport
|
|
|
|
@export var outrun = false
|
|
@export var galaga = false
|
|
@export var gradius = false
|
|
@export var snow = false
|
|
@export var slowrun = false
|
|
@export var letters = false
|
|
@export var background = true
|
|
#const FadeTrail = preload("res://shaders/fade_trail.gd")
|
|
@export var trail_modulate: Color = Color.WHITE
|
|
@export var trail_fade_speed: float = 2.0
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
if outrun: $OutrunInSpace.visible = true
|
|
if galaga: $Galaga.visible = true
|
|
if gradius: $Gradius.visible = true
|
|
if snow: $Snow.visible = true
|
|
if slowrun: $SlowRun.visible = true
|
|
if letters:
|
|
$Letters.visible = true
|
|
%FadeTimer.start()
|
|
if !background: $ColorRect.visible = false
|
|
|
|
|
|
func _on_fade_timer_timeout() -> void:
|
|
# 0 to duplicate so it does not make an instance
|
|
var graphics_copy := %Letters.duplicate(0)
|
|
#graphics_copy.set_script(FadeTrail)
|
|
graphics_copy.modulate = trail_modulate
|
|
graphics_copy.global_position = %Letters.global_position
|
|
graphics_copy.z_index = 0
|
|
graphics_copy.fade_speed = trail_fade_speed
|
|
%Trail.add_child(graphics_copy)
|