summaryrefslogtreecommitdiff
path: root/components/space_background.gd
diff options
context:
space:
mode:
authorSophia Pearson <codergal89@gmail.com>2026-05-20 09:39:22 +0200
committerSophia Pearson <codergal89@gmail.com>2026-05-20 09:39:22 +0200
commit75c83f4d7a628077d9ec98bfbd674699bfa20529 (patch)
tree092244938ba3f2bf9e4355840e7f65176a6f5e3f /components/space_background.gd
downloadmoon-buggy-2d-develop.tar.xz
moon-buggy-2d-develop.zip
initial gdscript rewritedevelop
Diffstat (limited to 'components/space_background.gd')
-rw-r--r--components/space_background.gd27
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
+