stars
This commit is contained in:
parent
cb3d54b9c2
commit
6b92473eeb
5 changed files with 368 additions and 1 deletions
35
objects/starfield/starfield.gd
Normal file
35
objects/starfield/starfield.gd
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue