Work on pickups and multiplayer

This commit is contained in:
2026-03-19 23:50:29 -04:00
parent d128501f7c
commit 9d931a3b46
42 changed files with 771 additions and 324 deletions

View File

@@ -81,26 +81,26 @@ func is_server() -> bool:
func is_host() -> bool:
return id == 1
func _process(delta: float) -> void:
func _process(_delta: float) -> void:
if waiting:
var ready : bool = true
var group_ready : bool = true
for pr in player_readiness.values():
if !pr:
ready = false
group_ready = false
break
if ready:
if group_ready:
all_ready.emit()
waiting = false
for pr in player_readiness.keys():
player_readiness[pr] = false
func _add_player_to_game(id : int) -> void:
print("Player %s joined the game!" % id)
func _add_player_to_game(pid : int) -> void:
print("Player %s joined the game!" % pid)
await get_tree().create_timer(0.5).timeout
get_handle_from_peer(id)
get_handle_from_peer(pid)
func _remove_player_from_game(id : int) -> void:
print("Player %s left the game!" % id)
func _remove_player_from_game(pid : int) -> void:
print("Player %s left the game!" % pid)
func get_handle_from_peer(peer_id) -> void:
rpc_id(peer_id, "report_handle_to_peer", id)