diff options
Diffstat (limited to 'components/space_background.gd')
| -rw-r--r-- | components/space_background.gd | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/components/space_background.gd b/components/space_background.gd new file mode 100644 index 0000000..b1e4ec0 --- /dev/null +++ b/components/space_background.gd @@ -0,0 +1,27 @@ +extends Node2D + +@export var autoscroll: bool = false: + set(value): + autoscroll = value + $Space.autoscroll.x = int(value) * 5 + $Stars.autoscroll.x = int(value) * 7 + +@export_enum("Blue", "Purple") var theme: int = 0: + set(value): + theme = value + apply_theme(theme) + +func _ready() -> void: + apply_theme(theme) + +func apply_theme(id: int) -> void: + match id: + 0: + $Space/Blue.visible = true + $Stars/Blue.visible = true + 1: + $Space/Blue.visible = false + $Stars/Blue.visible = false + $Space/Purple.visible = not $Space/Blue.visible + $Stars/Purple.visible = not $Stars/Blue.visible + |
