replace with multiplayer-coop files

This commit is contained in:
2026-01-08 16:47:52 +01:00
parent 1725c615ce
commit 22c7025ac4
1230 changed files with 20555 additions and 17232 deletions

28
src/scripts/stairs.gd Normal file
View File

@@ -0,0 +1,28 @@
extends Area2D
# Stairs that trigger level completion when player enters
func _ready():
# Connect body entered signal
body_entered.connect(_on_body_entered)
# Set collision layer/mask to detect players
collision_layer = 0
collision_mask = 1 # Detect players (layer 1)
func _on_body_entered(body: Node2D):
print("Stairs: Body entered: ", body, " is_player: ", body.is_in_group("player") if body else false, " is_dead: ", body.is_dead if body and "is_dead" in body else false)
if body and body.is_in_group("player") and not body.is_dead:
print("Stairs: Player entered stairs! Player: ", body.name)
# Only trigger on server/authority
if multiplayer.is_server() or not multiplayer.has_multiplayer_peer():
print("Stairs: Server detected, calling game_world")
var game_world = get_tree().get_first_node_in_group("game_world")
if game_world:
print("Stairs: Game world found, calling _on_player_reached_stairs")
game_world._on_player_reached_stairs(body)
else:
print("Stairs: ERROR - Game world not found!")
else:
print("Stairs: Not server, ignoring")