From 14538d486de312af41ce012836861468b8fb7897 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sun, 5 Jun 2022 14:09:41 -0600 Subject: finish all necessary for playability --- src/ui/hud/progress_bars/scripts/dash_progress.gd | 12 ++++++++++++ src/ui/hud/progress_bars/scripts/growth_progress.gd | 10 ++++++---- src/ui/hud/progress_bars/scripts/jump_progress.gd | 12 ++++++++++++ src/ui/hud/progress_bars/scripts/slow_progress.gd | 12 ++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 src/ui/hud/progress_bars/scripts/dash_progress.gd create mode 100644 src/ui/hud/progress_bars/scripts/jump_progress.gd create mode 100644 src/ui/hud/progress_bars/scripts/slow_progress.gd (limited to 'src/ui/hud/progress_bars/scripts') diff --git a/src/ui/hud/progress_bars/scripts/dash_progress.gd b/src/ui/hud/progress_bars/scripts/dash_progress.gd new file mode 100644 index 0000000..32fb91a --- /dev/null +++ b/src/ui/hud/progress_bars/scripts/dash_progress.gd @@ -0,0 +1,12 @@ +extends HBoxContainer + +onready var progress: TextureProgress = $Progress + + +func _ready(): + Event.connect("snake_dash_progress", self, "_on_snake_dash_progress") + progress.max_value = Global.POINTS_TO_DASH + + +func _on_snake_dash_progress(_progress: int) -> void: + progress.value = _progress diff --git a/src/ui/hud/progress_bars/scripts/growth_progress.gd b/src/ui/hud/progress_bars/scripts/growth_progress.gd index a9d455c..4efce10 100644 --- a/src/ui/hud/progress_bars/scripts/growth_progress.gd +++ b/src/ui/hud/progress_bars/scripts/growth_progress.gd @@ -1,10 +1,12 @@ -extends TextureProgress +extends HBoxContainer + +onready var progress: TextureProgress = $Progress func _ready(): Event.connect("snake_growth_progress", self, "_on_snake_growth_progress") - max_value = Global.POINTS_TO_GROW + progress.max_value = Global.POINTS_TO_GROW -func _on_snake_growth_progress(progress: int) -> void: - value = progress +func _on_snake_growth_progress(_progress: int) -> void: + progress.value = _progress diff --git a/src/ui/hud/progress_bars/scripts/jump_progress.gd b/src/ui/hud/progress_bars/scripts/jump_progress.gd new file mode 100644 index 0000000..367dd93 --- /dev/null +++ b/src/ui/hud/progress_bars/scripts/jump_progress.gd @@ -0,0 +1,12 @@ +extends HBoxContainer + +onready var progress: TextureProgress = $Progress + + +func _ready(): + Event.connect("snake_jump_progress", self, "_on_snake_jump_progress") + progress.max_value = Global.POINTS_TO_JUMP + + +func _on_snake_jump_progress(_progress: int) -> void: + progress.value = _progress diff --git a/src/ui/hud/progress_bars/scripts/slow_progress.gd b/src/ui/hud/progress_bars/scripts/slow_progress.gd new file mode 100644 index 0000000..de1bccb --- /dev/null +++ b/src/ui/hud/progress_bars/scripts/slow_progress.gd @@ -0,0 +1,12 @@ +extends HBoxContainer + +onready var progress: TextureProgress = $Progress + + +func _ready(): + Event.connect("snake_slow_progress", self, "_on_snake_slow_progress") + progress.max_value = Global.POINTS_TO_SLOW + + +func _on_snake_slow_progress(_progress: int) -> void: + progress.value = _progress -- cgit v1.2.3-70-g09d2