feat: Establish initial game structure including lobby, UI, and core gameplay managers.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user