feat: Add initial main game scene with grid map, player board UI, and manager scripts for game logic and input.
This commit is contained in:
@@ -72,7 +72,7 @@ func _on_boost_full():
|
||||
# player.is_attack_mode = true # Removed auto-activate
|
||||
emit_signal("bar_filled")
|
||||
NotificationManager.send_message(player, NotificationManager.MESSAGES.ATTACK_MODE_READY, NotificationManager.MessageType.POWERUP)
|
||||
print("[PowerUp] Player %s Boost Full! Entering Attack Mode." % player.name)
|
||||
print("[PowerUp] Player %s Boost Full! Ready for Attack Mode." % player.name)
|
||||
|
||||
if player.is_multiplayer_authority():
|
||||
rpc("sync_boost", current_boost)
|
||||
@@ -100,6 +100,14 @@ func sync_boost(value: float):
|
||||
# Could trigger visual effect here
|
||||
pass
|
||||
|
||||
@rpc("authority", "call_local", "reliable")
|
||||
func sync_boost_level(level: int):
|
||||
current_level = level
|
||||
var level_idx = clamp(current_level - 1, 0, FILL_TIMES.size() - 1)
|
||||
print("[PowerUp] Difficulty synced: Level %d (Fill Time: %.1fs)" % [current_level, FILL_TIMES[level_idx]])
|
||||
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Getters
|
||||
# =============================================================================
|
||||
@@ -113,6 +121,11 @@ func get_max_points() -> int:
|
||||
func get_fill_percentage() -> float:
|
||||
return current_boost / MAX_BOOST
|
||||
|
||||
func get_bars() -> int:
|
||||
"""Returns the number of filled segments (0-4)."""
|
||||
# Each bar is 25 points (100 / 4)
|
||||
return int(current_boost / 25.0)
|
||||
|
||||
func can_use_special() -> bool:
|
||||
# Use small epsilon for float comparison to avoid "99.999" issues
|
||||
return current_boost >= (MAX_BOOST - 0.1)
|
||||
@@ -177,3 +190,7 @@ func add_goal_completion_reward():
|
||||
print("[PowerUp] Player %s Completed Goal. Boost Level Up! Now: %d (Fill Time: %.1fs)" % [player.name, current_level, FILL_TIMES[level_idx]])
|
||||
|
||||
# Optional: Notify user of difficulty increase?
|
||||
|
||||
if multiplayer.is_server():
|
||||
rpc("sync_boost_level", current_level)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user