aboutsummaryrefslogtreecommitdiff
path: root/client/game.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/game.gd')
-rw-r--r--client/game.gd8
1 files changed, 5 insertions, 3 deletions
diff --git a/client/game.gd b/client/game.gd
index ac0fff9e..397a2b73 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -21,6 +21,7 @@ extends Node3D
signal update_players(players: Dictionary)
signal data_updated()
signal player_set_input_enabled(b: bool)
+signal joined()
var player_id: int = -1
var item_names: Array = []
@@ -89,6 +90,7 @@ func _ready():
player_instance = ControllablePlayer.new(player, player_name, pos, character, self)
camera.target = player_instance
player_set_input_enabled.connect(player_instance.set_input_enabled)
+ joined.emit()
else:
player_instance = Player.new(player, player_name, pos, character, self)
players[player] = player_instance
@@ -207,9 +209,6 @@ func _ready():
p.clear_message()
)
-
- mp.send_join(Global.profile["username"], Global.profile["character"])
-
mp.set_ingame.connect(func (state, in_lobby_):
in_lobby = in_lobby_
if state:
@@ -235,6 +234,9 @@ func _ready():
lobby.visible = lobby_state
)
+func join():
+ mp.send_join(Global.profile["username"], Global.profile["character"])
+
func _process(delta):
marker.position = Global.interpolate(marker.position, marker_target, delta * 30.)