mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
Added Disconnect screen
This commit is contained in:
parent
f265c7236e
commit
e113e1d250
@ -33,9 +33,10 @@ func _process(delta: float) -> void:
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if is_network_master():
|
||||
mode_switch(delta)
|
||||
screen_wrap()
|
||||
if get_tree().has_network_peer():
|
||||
if is_network_master():
|
||||
mode_switch(delta)
|
||||
screen_wrap()
|
||||
|
||||
|
||||
func mode_switch(delta):
|
||||
@ -117,10 +118,11 @@ func _network_peer_connected(id) -> void:
|
||||
|
||||
|
||||
func _on_network_tick_rate_timeout():
|
||||
if is_network_master():
|
||||
rset_unreliable("puppet_position", global_position)
|
||||
rset_unreliable("puppet_velocity", velocity)
|
||||
rset_unreliable("puppet_rotation", rotation_degrees)
|
||||
if get_tree().has_network_peer():
|
||||
if is_network_master():
|
||||
rset_unreliable("puppet_position", global_position)
|
||||
rset_unreliable("puppet_velocity", velocity)
|
||||
rset_unreliable("puppet_rotation", rotation_degrees)
|
||||
|
||||
|
||||
sync func update_position(pos):
|
||||
|
||||
@ -78,7 +78,7 @@ func _client_connection_timeout():
|
||||
print("Client has been timed out")
|
||||
reset_network_connection()
|
||||
|
||||
var connection_timeout_prompt = Global.instance_node(load("res://Simple_prompt.tscn"), get_tree().current_scene)
|
||||
var connection_timeout_prompt = Global.instance_node(load("res://scenes/simple_prompt.tscn"), get_tree().current_scene)
|
||||
connection_timeout_prompt.set_text("Connection timed out")
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ func _connection_failed():
|
||||
reset_network_connection()
|
||||
|
||||
if Global.ui != null:
|
||||
var prompt = Global.instance_node(load("res://Simple_prompt.tscn"), Global.ui)
|
||||
var prompt = Global.instance_node(load("res://scenes/simple_prompt.tscn"), Global.ui)
|
||||
prompt.set_text("Connection failed")
|
||||
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/floor.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://code/game.gd" type="Script" id=2]
|
||||
[ext_resource path="res://code/UI.gd" type="Script" id=3]
|
||||
|
||||
[node name="game" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
@ -23,3 +24,6 @@ position = Vector2( 512, 270 )
|
||||
|
||||
[node name="4" type="Position2D" parent="spawn_locations"]
|
||||
position = Vector2( 1408, 270 )
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user