Implement basic networking
This commit is contained in:
parent
c320d9ddcb
commit
994823a9c3
25 changed files with 643 additions and 217 deletions
|
|
@ -5,6 +5,8 @@
|
|||
[ext_resource type="Script" uid="uid://n557xfrv0i6x" path="res://scripts/GameControlManager.cs" id="4_lbhrr"]
|
||||
[ext_resource type="Script" uid="uid://bwgjvm21oi3d6" path="res://scripts/GameManager.cs" id="4_p57ef"]
|
||||
[ext_resource type="Script" uid="uid://betypbypf6bf2" path="res://scripts/GameMenuController.cs" id="5_iywne"]
|
||||
[ext_resource type="Script" uid="uid://bo57chobyuegg" path="res://scripts/NetworkManager.cs" id="5_p57ef"]
|
||||
[ext_resource type="Script" uid="uid://by0357lop0qge" path="res://scripts/RPCNode.cs" id="6_u5sy4"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_p57ef"]
|
||||
size = Vector3(2, 0.1, 2)
|
||||
|
|
@ -15,31 +17,37 @@ size = Vector3(10, 0.5, 10)
|
|||
[sub_resource type="BoxShape3D" id="BoxShape3D_uwrxv"]
|
||||
size = Vector3(10, 5, 10)
|
||||
|
||||
[node name="Game" type="Node3D" unique_id=1201210338 node_paths=PackedStringArray("GameMenu", "QueueManager")]
|
||||
[node name="Game" type="Node3D" unique_id=1201210338 node_paths=PackedStringArray("GameMenu", "QueueManager", "SpaceRoot")]
|
||||
script = ExtResource("4_p57ef")
|
||||
GameMenu = NodePath("GameMenu")
|
||||
QueueManager = NodePath("QueueManager")
|
||||
closeTickInterval = 0.01
|
||||
SpaceRoot = NodePath("Space")
|
||||
closeTickInterval = 0.1
|
||||
|
||||
[node name="Plane" type="StaticBody3D" parent="." unique_id=1260154250]
|
||||
[node name="Space" type="Node3D" parent="." unique_id=1006247987]
|
||||
|
||||
[node name="Plane" type="StaticBody3D" parent="Space" unique_id=1260154250]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.99999994, 0, 0, 0, 0.99999994, 0, -10, 0)
|
||||
|
||||
[node name="PlaneMesh" type="MeshInstance3D" parent="Plane" unique_id=107049489]
|
||||
[node name="PlaneMesh" type="MeshInstance3D" parent="Space/Plane" unique_id=107049489]
|
||||
transform = Transform3D(5, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 0)
|
||||
mesh = SubResource("BoxMesh_p57ef")
|
||||
|
||||
[node name="PlaneCollider" type="CollisionShape3D" parent="Plane" unique_id=970373853]
|
||||
[node name="PlaneCollider" type="CollisionShape3D" parent="Space/Plane" unique_id=970373853]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, 0)
|
||||
shape = SubResource("BoxShape3D_8cj0n")
|
||||
|
||||
[node name="GravityZone" type="Area3D" parent="Plane" unique_id=1326543003]
|
||||
[node name="GravityZone" type="Area3D" parent="Space/Plane" unique_id=1326543003]
|
||||
gravity_space_override = 2
|
||||
script = ExtResource("1_yqjtg")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Plane/GravityZone" unique_id=772916098]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Space/Plane/GravityZone" unique_id=772916098]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 0)
|
||||
shape = SubResource("BoxShape3D_uwrxv")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Space/Plane" unique_id=226559047]
|
||||
transform = Transform3D(1, 0, 0, 0, 1.0000000600000036, 0, 0, 0, 1.0000000600000036, 0, 10.000000600000035, 0)
|
||||
|
||||
[node name="GameControlManager" type="Node" parent="." unique_id=1751385863 node_paths=PackedStringArray("GameMenu")]
|
||||
script = ExtResource("4_lbhrr")
|
||||
GameMenu = NodePath("../GameMenu")
|
||||
|
|
@ -47,6 +55,13 @@ GameMenu = NodePath("../GameMenu")
|
|||
[node name="QueueManager" type="Node" parent="." unique_id=355148200]
|
||||
script = ExtResource("4_iywne")
|
||||
|
||||
[node name="NetworkManager" type="Node" parent="." unique_id=1765485895 node_paths=PackedStringArray("RPCNode")]
|
||||
script = ExtResource("5_p57ef")
|
||||
RPCNode = NodePath("../RPC")
|
||||
|
||||
[node name="RPC" type="Node" parent="." unique_id=498537245]
|
||||
script = ExtResource("6_u5sy4")
|
||||
|
||||
[node name="GameMenu" type="Control" parent="." unique_id=223510406]
|
||||
visible = false
|
||||
layout_mode = 3
|
||||
|
|
@ -77,8 +92,6 @@ offset_bottom = 63.0
|
|||
layout_mode = 2
|
||||
text = "Main Menu"
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="." unique_id=226559047]
|
||||
|
||||
[connection signal="body_entered" from="Plane/GravityZone" to="Plane/GravityZone" method="OnBodyEntered"]
|
||||
[connection signal="body_exited" from="Plane/GravityZone" to="Plane/GravityZone" method="OnBodyExited"]
|
||||
[connection signal="body_entered" from="Space/Plane/GravityZone" to="Space/Plane/GravityZone" method="OnBodyEntered"]
|
||||
[connection signal="body_exited" from="Space/Plane/GravityZone" to="Space/Plane/GravityZone" method="OnBodyExited"]
|
||||
[connection signal="pressed" from="GameMenu/VBoxContainer/MainMenuButton" to="GameMenu" method="OnMainMenu"]
|
||||
|
|
|
|||
|
|
@ -23,13 +23,18 @@ grow_vertical = 2
|
|||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="StartGameButton" type="Button" parent="CenterContainer/VBoxContainer" unique_id=364461644]
|
||||
[node name="HostGameButton" type="Button" parent="CenterContainer/VBoxContainer" unique_id=364461644]
|
||||
layout_mode = 2
|
||||
text = "Start Game"
|
||||
text = "Host Game"
|
||||
|
||||
[node name="JoinGameButton" type="Button" parent="CenterContainer/VBoxContainer" unique_id=1719078976]
|
||||
layout_mode = 2
|
||||
text = "Join Game"
|
||||
|
||||
[node name="ExitGameButton" type="Button" parent="CenterContainer/VBoxContainer" unique_id=1050417063]
|
||||
layout_mode = 2
|
||||
text = "Exit Game"
|
||||
|
||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/StartGameButton" to="." method="OnStartGame"]
|
||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/HostGameButton" to="." method="OnHostGame"]
|
||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/JoinGameButton" to="." method="OnJoinGame"]
|
||||
[connection signal="pressed" from="CenterContainer/VBoxContainer/ExitGameButton" to="." method="OnExitGame"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue