ready buttons work
This commit is contained in:
@ -1,3 +1,25 @@
|
||||
class_name HumanController
|
||||
extends PlayerController
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if not is_multiplayer_authority():
|
||||
return
|
||||
$Camera2D.make_current()
|
||||
$UI.visible = true
|
||||
|
||||
|
||||
@rpc("call_local")
|
||||
func ready_player():
|
||||
game.ready_player(own_id)
|
||||
|
||||
|
||||
@rpc("any_peer")
|
||||
func update_ready_label():
|
||||
$UI/LobbyReadyLabel.text = str(game.readied_players.size()) + "/" + str(game.players.size())
|
||||
|
||||
|
||||
func _on_lobby_ready_button_pressed() -> void:
|
||||
rpc("ready_player")
|
||||
$UI/LobbyReadyButton.visible = false
|
||||
update_ready_label()
|
||||
|
@ -1,2 +1,6 @@
|
||||
class_name PlayerController
|
||||
extends Node
|
||||
|
||||
var game: Game
|
||||
var board: PlayerBoard
|
||||
var own_id: int
|
||||
|
Reference in New Issue
Block a user