summaryrefslogtreecommitdiff
path: root/components/space_background.gd
blob: b1e4ec07fa0b338098d95d9ca3b4033ada04fcc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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