forked from interstellar_development/freeftf
Computer Fixing
This commit is contained in:
parent
10551189f9
commit
89ccda1523
3 changed files with 25 additions and 10 deletions
|
@ -11,7 +11,9 @@ func _ready():
|
|||
Game.computers += 1
|
||||
|
||||
func _on_computer_tick_timeout():
|
||||
current += (pc_occupied[0] + pc_occupied[1] + pc_occupied[2])
|
||||
if multiplayer.is_server():
|
||||
current += (pc_occupied[0] + pc_occupied[1] + pc_occupied[2])
|
||||
Server.sync_computers.rpc(name, current)
|
||||
if current >= TARGET:
|
||||
current = "Complete"
|
||||
$computer_tick.stop()
|
||||
|
|
|
@ -31,10 +31,17 @@ func create_game():
|
|||
@rpc("any_peer", "call_remote", "reliable")
|
||||
func send_playerinfo(name, id):
|
||||
if multiplayer.is_server():
|
||||
var done = 0
|
||||
players[id] = name
|
||||
label = get_tree().root.get_node("create/player_list/list")
|
||||
label.text = ""
|
||||
for w in players:
|
||||
label.text = str(label.text +"\n" + players[w])
|
||||
if done == 1:
|
||||
label.text = str(label.text +"\n" + players[w])
|
||||
else:
|
||||
label.text = players[w]
|
||||
done = 1
|
||||
|
||||
|
||||
@rpc("authority", "call_local", "reliable")
|
||||
func start_game(server_players):
|
||||
|
@ -55,3 +62,9 @@ func sync_player(node_name, position, rotation):
|
|||
var current_character = get_tree().root.get_node("./"+node_name)
|
||||
current_character.position = position
|
||||
current_character.rotation = rotation
|
||||
|
||||
@rpc("authority", "call_local", "reliable")
|
||||
func sync_computers(node_name, current):
|
||||
var current_character = get_tree().root.get_node("./map/"+node_name)
|
||||
print(current_character)
|
||||
current_character.current = current
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue