small racing game im working on
Diffstat (limited to 'ui/gears.gd')
-rw-r--r--ui/gears.gd13
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/gears.gd b/ui/gears.gd
new file mode 100644
index 0000000..12b89fd
--- /dev/null
+++ b/ui/gears.gd
@@ -0,0 +1,13 @@
+extends RichTextLabel
+
+var car: Car
+
+# assumes 6 gear + rev
+const F_STRING = "[center] [b]%s[/b][/center]"
+const GEARS: PackedStringArray = ["[color=#4682b4]N[/color]", "1", "2", "3", "4", "5", "6", "[color=#d84341]R[/color]"]
+
+func _process(_delta: float) -> void:
+ text = F_STRING % GEARS[car.current_gear]
+
+func assigned(_car: Car) -> void:
+ car = _car