feat: Implement initial game structure with core logic, various managers, player scene, and project configuration.
This commit is contained in:
+16
-4
@@ -7,6 +7,10 @@ var input_manager
|
||||
var playerboard_manager
|
||||
var action_manager
|
||||
var special_tiles_manager
|
||||
var powerup_manager
|
||||
|
||||
# Score tracking
|
||||
var score: int = 0
|
||||
|
||||
# Special effect states
|
||||
var is_frozen: bool = false
|
||||
@@ -223,6 +227,11 @@ func _init_managers():
|
||||
special_tiles_manager.name = "SpecialTilesManager"
|
||||
add_child(special_tiles_manager)
|
||||
special_tiles_manager.initialize(self, enhanced_gridmap)
|
||||
|
||||
powerup_manager = load("res://scripts/managers/powerup_manager.gd").new()
|
||||
powerup_manager.name = "PowerUpManager"
|
||||
add_child(powerup_manager)
|
||||
powerup_manager.initialize(self, enhanced_gridmap)
|
||||
|
||||
# Add function to check if position is at finish line
|
||||
func is_at_finish_line() -> bool:
|
||||
@@ -366,16 +375,19 @@ func _physics_process(delta):
|
||||
rpc("remote_set_position", global_position)
|
||||
last_sent_position = global_position
|
||||
|
||||
# Add continuous finish line check (uses lap-aware finish locations)
|
||||
var current_finish = race_manager.get_current_finish_locations() if race_manager else []
|
||||
if race_manager and current_position in current_finish and can_finish and not is_player_moving:
|
||||
finish_race() # This handles lap increment and calls start_new_lap properly
|
||||
# NOTE: Finish line checking removed - game uses cycle-based goals system now
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# Input
|
||||
# --------------------------------------------------------------------
|
||||
|
||||
func _unhandled_input(event):
|
||||
# Handle power-up usage
|
||||
if event.is_action_pressed("use_powerup") and is_multiplayer_authority():
|
||||
if powerup_manager and powerup_manager.can_use_special():
|
||||
powerup_manager.use_special_effect()
|
||||
return
|
||||
|
||||
if input_manager:
|
||||
input_manager.handle_unhandled_input(event)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user