edit special power up

This commit is contained in:
2026-01-09 22:41:00 +08:00
parent 6aede0a382
commit 6948a4aed1
11 changed files with 326 additions and 468 deletions
+1 -50
View File
@@ -6,7 +6,6 @@ extends Node3D
# Manager references
var ui_manager
var obstacle_manager
var goals_cycle_manager
var screen_shake_manager
var touch_controls
@@ -31,7 +30,6 @@ func _ready():
ui_manager.setup_timer_labels(self)
ui_manager.setup_leaderboard_ui(self)
ui_manager.setup_powerup_bar_ui(self)
_setup_obstacle_ui()
# GlobalMatchTimer is now static in main.tscn - no setup needed
# NetworkPanel is visible during gameplay
@@ -48,11 +46,6 @@ func _init_managers():
add_child(ui_manager)
ui_manager.initialize(self)
obstacle_manager = load("res://scripts/managers/obstacle_manager.gd").new()
obstacle_manager.name = "ObstacleManager"
add_child(obstacle_manager)
obstacle_manager.initialize($EnhancedGridMap)
# Goals cycle manager for 60-second timer and scoring
goals_cycle_manager = load("res://scripts/managers/goals_cycle_manager.gd").new()
goals_cycle_manager.name = "GoalsCycleManager"
@@ -184,25 +177,6 @@ func add_message_to_bar(player_name: String, message: String, type: int = Messag
func broadcast_message(player_name: String, message: String):
add_message_to_bar(player_name, message)
func _setup_obstacle_ui():
var obstacle_button = Button.new()
obstacle_button.text = "Place Obstacle"
obstacle_button.pressed.connect(func(): _set_action_state(ui_manager.ActionState.PLACING_OBSTACLE))
$ActionMenu/ActionButtonContainer.add_child(obstacle_button)
var orientation_button = Button.new()
orientation_button.text = "Direction: North"
orientation_button.pressed.connect(func():
orientation_button.text = obstacle_manager.cycle_obstacle_orientation()
)
$ActionMenu/ActionButtonContainer.add_child(orientation_button)
var type_button = Button.new()
type_button.text = "Type: 1"
type_button.pressed.connect(func():
type_button.text = obstacle_manager.cycle_obstacle_type()
)
$ActionMenu/ActionButtonContainer.add_child(type_button)
func _setup_global_match_timer_ui():
"""Create the global match timer display at the top of the screen."""
@@ -608,8 +582,7 @@ func _set_action_state(new_state):
ui_manager.ActionState.ARRANGING:
_show_arrangement_ui()
local_player.highlight_occupied_playerboard_slots()
ui_manager.ActionState.PLACING_OBSTACLE:
local_player.highlight_valid_obstacle_cells()
func _show_arrangement_ui():
if ui_manager.playerboard_ui:
@@ -626,28 +599,6 @@ func _on_playerboard_slot_clicked(event, slot_index):
ui_manager.ActionState.ARRANGING:
local_player.arrange_playerboard_item(slot_index)
# =============================================================================
# Obstacle Management
# =============================================================================
func place_obstacle(grid_position: Vector2i) -> bool:
var local_player = GameStateManager.local_player_character
var success = obstacle_manager.place_obstacle(grid_position, local_player)
if success:
local_player.clear_highlights()
_set_action_state(ui_manager.ActionState.NONE)
if is_multiplayer_authority():
rpc("sync_place_obstacle", grid_position.x, grid_position.y, 3,
obstacle_manager.current_obstacle_item, obstacle_manager.current_obstacle_orientation)
return success
@rpc("any_peer", "call_local")
func sync_place_obstacle(x: int, y: int, floor_index: int, item_index: int, orientation: int):
$EnhancedGridMap.place_obstacle(Vector3i(x, floor_index, y), item_index, orientation)
# =============================================================================
# Goal & Playerboard Sync
# =============================================================================