feat: Establish initial game structure including lobby, UI, and core gameplay managers.

This commit is contained in:
Yogi Wiguna
2026-02-02 15:01:30 +08:00
parent 9201c99d42
commit 66d34d0d29
21 changed files with 1688 additions and 1475 deletions
+6 -2
View File
@@ -271,7 +271,10 @@ func setup_powerup_bar_ui(main_node):
func update_powerup_bar(current_points: int, _max_points: int):
"""Update battery segments based on current power-up points."""
var bars_filled = current_points / 4 # 4 points per bar
# 4 Segments total. Max Boost is 100. So each segment represents 25 points.
# Was previously dividing by 4, causing it to fill at 16 points!
var points_per_segment = _max_points / 4.0
var bars_filled = int(current_points / points_per_segment)
for i in range(powerup_segments.size()):
var segment = powerup_segments[i]
@@ -289,7 +292,8 @@ func update_powerup_bar(current_points: int, _max_points: int):
var _previous_bars: int = 0
func _on_powerup_points_changed(current: int, max_points: int):
var new_bars = current / 4
# Calculate based on max points (100) / 4 segments = 25 points per segment
var new_bars = int(current / 25.0)
# Detect if a new bar was filled
if new_bars > _previous_bars and powerup_bar: