Added working progress bar to the passage

This commit is contained in:
2025-12-11 17:53:39 +03:00
parent 0f317362dc
commit ea13a8b727
4 changed files with 32 additions and 4 deletions
+25
View File
@@ -5,8 +5,33 @@ extends Node2D
signal player_died
@export var data : PassageData:
set = _set_data
var _current_progress := 0.0
@onready var enemy_swamp_controller : EnemySwampController = $EnemySwampController
@onready var enemy_timer : Timer = $EnemyTimer
@onready var progress_bar : TextureProgressBar = $ProgressBar
func _physics_process(delta: float) -> void:
if data:
_current_progress += delta
_update_progress_indicator()
func _set_data(new_data: PassageData) -> void:
data = new_data
if data and progress_bar:
_update_progress_indicator()
func _update_progress_indicator() -> void:
progress_bar.value = _current_progress
progress_bar.max_value = data.length
func _on_enemy_timer_timeout() -> void: