diff --git a/scene/EscapeMenu.tscn b/scene/EscapeMenu.tscn index a89714f..105b111 100644 --- a/scene/EscapeMenu.tscn +++ b/scene/EscapeMenu.tscn @@ -28,22 +28,22 @@ anchor_right = 1.0 anchor_bottom = 1.0 [node name="PanelContainer" type="PanelContainer" parent="CenterContainer"] -margin_left = 527.0 +margin_left = 522.0 margin_top = 274.0 -margin_right = 752.0 +margin_right = 757.0 margin_bottom = 446.0 [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/PanelContainer"] margin_left = 7.0 margin_top = 7.0 -margin_right = 218.0 +margin_right = 228.0 margin_bottom = 165.0 __meta__ = { "_edit_use_anchors_": false } [node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer"] -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 9.0 text = "Pause Menu" align = 1 @@ -53,12 +53,12 @@ __meta__ = { [node name="HSeparator" type="HSeparator" parent="CenterContainer/PanelContainer/VBoxContainer"] margin_top = 13.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 17.0 [node name="ContainerStatus" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"] margin_top = 21.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 34.0 [node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerStatus"] @@ -70,8 +70,9 @@ text = "Status:" align = 2 [node name="Status" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerStatus"] +modulate = Color( 1, 0, 0, 1 ) margin_left = 40.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 13.0 rect_min_size = Vector2( 0, 13 ) size_flags_horizontal = 3 @@ -85,7 +86,7 @@ __meta__ = { [node name="ContainerServer" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"] margin_top = 38.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 57.0 [node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerServer"] @@ -110,7 +111,7 @@ __meta__ = { [node name="ServerStartStop" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerServer"] margin_left = 94.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 19.0 size_flags_horizontal = 3 text = "Start Server" @@ -120,7 +121,7 @@ __meta__ = { [node name="ContainerClient" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"] margin_top = 61.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 80.0 [node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerClient"] @@ -141,14 +142,15 @@ caret_blink = true [node name="ClientDisConnect" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerClient"] margin_left = 164.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 19.0 +rect_min_size = Vector2( 57, 0 ) size_flags_horizontal = 3 text = "Connect" [node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"] margin_top = 84.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 108.0 [node name="HideAddress" type="CheckBox" parent="CenterContainer/PanelContainer/VBoxContainer/HBoxContainer"] @@ -166,12 +168,12 @@ text = "(for streamers etc.)" [node name="HSeparator2" type="HSeparator" parent="CenterContainer/PanelContainer/VBoxContainer"] margin_top = 112.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 116.0 [node name="Quit" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer"] margin_top = 120.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 137.0 rect_min_size = Vector2( 0, 17 ) @@ -196,7 +198,7 @@ __meta__ = { [node name="Return" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer"] margin_top = 141.0 -margin_right = 211.0 +margin_right = 221.0 margin_bottom = 158.0 rect_min_size = Vector2( 0, 17 ) __meta__ = { diff --git a/scene/OtherPlayer.tscn b/scene/OtherPlayer.tscn new file mode 100644 index 0000000..4b28165 --- /dev/null +++ b/scene/OtherPlayer.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://gfx/player.png" type="Texture" id=2] + +[sub_resource type="CircleShape2D" id=1] +radius = 8.0 + +[node name="OtherPlayer" type="KinematicBody2D"] +collision_layer = 0 + +[node name="CircleShape" type="CollisionShape2D" parent="."] +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 2 ) diff --git a/scene/Player.tscn b/scene/Player.tscn index 26e90bb..7d0c128 100644 --- a/scene/Player.tscn +++ b/scene/Player.tscn @@ -8,11 +8,8 @@ radius = 8.0 [node name="Player" type="KinematicBody2D"] -position = Vector2( 640, 360 ) +collision_layer = 0 script = ExtResource( 3 ) -__meta__ = { -"_edit_group_": true -} [node name="Camera2D" type="Camera2D" parent="."] current = true diff --git a/src/EscapeMenu.cs b/src/EscapeMenu.cs index 4e40430..30df466 100644 --- a/src/EscapeMenu.cs +++ b/src/EscapeMenu.cs @@ -1,8 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; using Godot; +// TODO: Split network and escape menu logic. public class EscapeMenu : Container { - [Export] public int DefaultPort { get; set; } = 25565; + [Export] public ushort DefaultPort { get; set; } = 42005; [Export] public string DefaultAddress { get; set; } = "localhost"; [Export] public NodePath StatusPath { get; set; } @@ -19,6 +23,15 @@ public class EscapeMenu : Container public LineEdit ClientAddress { get; private set; } public Button Return { get; private set; } + public Node PlayerContainer { get; private set; } + public Player OwnPlayer { get; private set; } + public PackedScene OtherPlayer { get; private set; } + + public override void _Ready() + { + OtherPlayer = GD.Load("res://scene/OtherPlayer.tscn"); + } + public override void _EnterTree() { Status = GetNode