From e1ecd7f01e2db6f1933e631a5caeb9f32c3e16f3 Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 13 Apr 2021 20:11:28 +0200 Subject: [PATCH] Add Escape Menu and restructure The escape menu pauses the game and will allow for creating and connecting to multiplayer games. - Move scenes to scene/ folder - Move scripts to src/ folder - Add Hearbit font and CREDITS.md - Remove git integration (we have VS Code) --- .gitignore | 2 +- .vscode/settings.json | 4 + CREDITS.md | 9 ++ GameScene.tscn | 105 -------------- HeartbitXX.ttf | Bin 0 -> 40248 bytes project.godot | 19 +-- Block.tscn => scene/Block.tscn | 0 scene/EscapeMenu.tscn | 228 +++++++++++++++++++++++++++++++ scene/GameScene.tscn | 27 ++++ Player.tscn => scene/Player.tscn | 4 +- Camera.cs => src/Camera.cs | 2 +- Cursor.cs => src/Cursor.cs | 0 src/EscapeMenu.cs | 80 +++++++++++ Game.cs => src/Game.cs | 2 +- Player.cs => src/Player.cs | 0 ui_theme.tres | 24 ++++ 16 files changed, 387 insertions(+), 119 deletions(-) create mode 100644 CREDITS.md delete mode 100644 GameScene.tscn create mode 100644 HeartbitXX.ttf rename Block.tscn => scene/Block.tscn (100%) create mode 100644 scene/EscapeMenu.tscn create mode 100644 scene/GameScene.tscn rename Player.tscn => scene/Player.tscn (81%) rename Camera.cs => src/Camera.cs (90%) rename Cursor.cs => src/Cursor.cs (100%) create mode 100644 src/EscapeMenu.cs rename Game.cs => src/Game.cs (95%) rename Player.cs => src/Player.cs (100%) create mode 100644 ui_theme.tres diff --git a/.gitignore b/.gitignore index 0e3fbb1..57ae9d7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,6 @@ /bin/ /build/ /lib/ -/git_api.* *.translation export_presets.cfg +mono_crash.* diff --git a/.vscode/settings.json b/.vscode/settings.json index d0964bf..af8c495 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,4 +5,8 @@ "files.trimTrailingWhitespace": true, "files.trimFinalNewlines": true, "files.insertFinalNewline": true, + + "[markdown]": { + "files.trimTrailingWhitespace": false, + } } diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..9feccdf --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,9 @@ +# Assets + +## Heartbit Font + +**URL:** https://arcade.itch.io/heartbit +**Author:** Void +**License:** Custom +> You can use this font in free and personal projects, works or games. +> You'll need to pay the suggested price for commercial projects. diff --git a/GameScene.tscn b/GameScene.tscn deleted file mode 100644 index ee386ff..0000000 --- a/GameScene.tscn +++ /dev/null @@ -1,105 +0,0 @@ -[gd_scene load_steps=6 format=2] - -[ext_resource path="res://Player.tscn" type="PackedScene" id=1] -[ext_resource path="res://gfx/cursor.png" type="Texture" id=2] -[ext_resource path="res://Block.tscn" type="PackedScene" id=3] -[ext_resource path="res://Game.cs" type="Script" id=4] -[ext_resource path="res://Cursor.cs" type="Script" id=5] - -[node name="Game" type="Node"] -script = ExtResource( 4 ) -Player = ExtResource( 1 ) -Block = ExtResource( 3 ) - -[node name="Cursor" type="Node2D" parent="."] -z_index = 4096 -script = ExtResource( 5 ) -__meta__ = { -"_edit_group_": true -} - -[node name="Sprite" type="Sprite" parent="Cursor"] -texture = ExtResource( 2 ) - -[node name="HUD" type="CanvasLayer" parent="."] - -[node name="Menu" type="CenterContainer" parent="HUD"] -visible = false -anchor_right = 1.0 -anchor_bottom = 1.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Panel" type="PanelContainer" parent="HUD/Menu"] -margin_left = 633.0 -margin_top = 353.0 -margin_right = 647.0 -margin_bottom = 367.0 - -[node name="VBoxContainer" type="VBoxContainer" parent="HUD/Menu/Panel"] -margin_left = 7.0 -margin_top = 7.0 -margin_right = 175.0 -margin_bottom = 113.0 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Label" type="Label" parent="HUD/Menu/Panel/VBoxContainer"] -margin_right = 168.0 -margin_bottom = 14.0 -text = "Menu" -align = 1 -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="HSeparator" type="HSeparator" parent="HUD/Menu/Panel/VBoxContainer"] -margin_top = 18.0 -margin_right = 168.0 -margin_bottom = 22.0 - -[node name="StartServer" type="Button" parent="HUD/Menu/Panel/VBoxContainer"] -margin_top = 26.0 -margin_right = 168.0 -margin_bottom = 46.0 -text = "Start Server" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="HBoxContainer2" type="HBoxContainer" parent="HUD/Menu/Panel/VBoxContainer"] -margin_top = 50.0 -margin_right = 168.0 -margin_bottom = 74.0 - -[node name="Address" type="LineEdit" parent="HUD/Menu/Panel/VBoxContainer/HBoxContainer2"] -margin_right = 100.0 -margin_bottom = 24.0 -rect_min_size = Vector2( 100, 0 ) -caret_blink = true - -[node name="Connect" type="Button" parent="HUD/Menu/Panel/VBoxContainer/HBoxContainer2"] -margin_left = 104.0 -margin_right = 168.0 -margin_bottom = 24.0 -text = "Connect" - -[node name="Disconnect" type="Button" parent="HUD/Menu/Panel/VBoxContainer"] -visible = false -margin_top = 78.0 -margin_right = 168.0 -margin_bottom = 98.0 -text = "Disconnect" - -[node name="HSeparator2" type="HSeparator" parent="HUD/Menu/Panel/VBoxContainer"] -margin_top = 78.0 -margin_right = 168.0 -margin_bottom = 82.0 - -[node name="BackToGame" type="Button" parent="HUD/Menu/Panel/VBoxContainer"] -margin_top = 86.0 -margin_right = 168.0 -margin_bottom = 106.0 -text = "Back to Game" diff --git a/HeartbitXX.ttf b/HeartbitXX.ttf new file mode 100644 index 0000000000000000000000000000000000000000..71ff9adccec13c50d3cf60a6b393bc79448de771 GIT binary patch literal 40248 zcmdUY3z!|nb>^wQcjihO2_d9GJTyY1VUUmnNE!wSB-vL2iHBt%yo@o%4ALNt(JNwv z0Xw8ZFn%PlF($-z{J=@paU6m%**IQ1@%DQCC0;M&0$on7Mad0B^bHa6P- zKc}j@`rf`Xup1}emUO$TtGmv-PMvymk2n!ILA*5N)?K@T>uyQWvj%IxhT z^E~c1_f6b+}0@y0QjCeIC1w8_pJN_?q7!I zR~(u+IQi4^ZqWYl_fYor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NP?jiRc_pp1fd&K>sd({1sd!Kv1`+)mp_d)j|_hI)D z_n7-=>)4^G_3O8S^B2qV~MWBHP*-$e6Tq|4xHAsi%QUOF{769h$E3)%1 z-E;Wh!3iUF{=Vd5;Igvr!2UAdyzI7#qs{#|^j|(bbztvg|CF9umj_O!0wIKyuN)+XQq#PtD!nzIgzL{wuBiA*+97Qf2<3v zva$2fzQ*LCeXXkk^M?cTR~hq%^|aus{l^aNn>c#x;DL!_(+du#SN+!*4M&ZJYZA2c zk0uxW*BA{)?R2fxx>HXB*OsCixU%D7zs|r+>#2DiRXRb z)T3=2-?brJt7pS?sK0ARD8D$IFA3+JJdYumU=(otxW)n&B%FZ0-gX9Lq14$8i|_vM W#V7v@ufKHn+U-35#r1!=|Nj7&Ng<*D literal 0 HcmV?d00001 diff --git a/project.godot b/project.godot index 60508e5..9494eea 100644 --- a/project.godot +++ b/project.godot @@ -8,20 +8,15 @@ config_version=4 -_global_script_classes=[ { -"base": "", -"class": "GitAPI", -"language": "NativeScript", -"path": "res://git_api.gdns" -} ] +_global_script_classes=[ ] _global_script_class_icons={ -"GitAPI": "" + } [application] config/name="YourfortV" -run/main_scene="res://GameScene.tscn" +run/main_scene="res://scene/GameScene.tscn" config/icon="res://gfx/icon.png" [display] @@ -32,7 +27,7 @@ window/stretch/mode="viewport" [gdnative] -singletons=[ "res://git_api.gdnlib" ] +singletons=[ ] [importer_defaults] @@ -59,6 +54,12 @@ texture={ [input] +ui_menu={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) + ] +} move_left={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) diff --git a/Block.tscn b/scene/Block.tscn similarity index 100% rename from Block.tscn rename to scene/Block.tscn diff --git a/scene/EscapeMenu.tscn b/scene/EscapeMenu.tscn new file mode 100644 index 0000000..a89714f --- /dev/null +++ b/scene/EscapeMenu.tscn @@ -0,0 +1,228 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://ui_theme.tres" type="Theme" id=1] +[ext_resource path="res://src/EscapeMenu.cs" type="Script" id=2] + +[node name="EscapeMenu" type="Container"] +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = ExtResource( 1 ) +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} +StatusPath = NodePath("CenterContainer/PanelContainer/VBoxContainer/ContainerStatus/Status") +ServerStartStopPath = NodePath("CenterContainer/PanelContainer/VBoxContainer/ContainerServer/ServerStartStop") +ServerPortPath = NodePath("CenterContainer/PanelContainer/VBoxContainer/ContainerServer/ServerPort") +ClientDisConnectPath = NodePath("CenterContainer/PanelContainer/VBoxContainer/ContainerClient/ClientDisConnect") +ClientAddressPath = NodePath("CenterContainer/PanelContainer/VBoxContainer/ContainerClient/ClientAddress") +ReturnPath = NodePath("CenterContainer/PanelContainer/VBoxContainer/Return") + +[node name="ColorRect" type="ColorRect" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +color = Color( 0, 0, 0, 0.501961 ) + +[node name="CenterContainer" type="CenterContainer" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 + +[node name="PanelContainer" type="PanelContainer" parent="CenterContainer"] +margin_left = 527.0 +margin_top = 274.0 +margin_right = 752.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_bottom = 165.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer"] +margin_right = 211.0 +margin_bottom = 9.0 +text = "Pause Menu" +align = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="HSeparator" type="HSeparator" parent="CenterContainer/PanelContainer/VBoxContainer"] +margin_top = 13.0 +margin_right = 211.0 +margin_bottom = 17.0 + +[node name="ContainerStatus" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"] +margin_top = 21.0 +margin_right = 211.0 +margin_bottom = 34.0 + +[node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerStatus"] +margin_top = 2.0 +margin_right = 36.0 +margin_bottom = 11.0 +rect_min_size = Vector2( 36, 0 ) +text = "Status:" +align = 2 + +[node name="Status" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerStatus"] +margin_left = 40.0 +margin_right = 211.0 +margin_bottom = 13.0 +rect_min_size = Vector2( 0, 13 ) +size_flags_horizontal = 3 +size_flags_vertical = 5 +text = "No Connection" +align = 1 +valign = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ContainerServer" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"] +margin_top = 38.0 +margin_right = 211.0 +margin_bottom = 57.0 + +[node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerServer"] +margin_top = 5.0 +margin_right = 36.0 +margin_bottom = 14.0 +rect_min_size = Vector2( 36, 0 ) +text = "Port:" +align = 2 + +[node name="ServerPort" type="LineEdit" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerServer"] +margin_left = 40.0 +margin_right = 90.0 +margin_bottom = 19.0 +custom_constants/minimum_spaces = 8 +align = 1 +max_length = 6 +caret_blink = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ServerStartStop" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerServer"] +margin_left = 94.0 +margin_right = 211.0 +margin_bottom = 19.0 +size_flags_horizontal = 3 +text = "Start Server" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ContainerClient" type="HBoxContainer" parent="CenterContainer/PanelContainer/VBoxContainer"] +margin_top = 61.0 +margin_right = 211.0 +margin_bottom = 80.0 + +[node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerClient"] +margin_top = 5.0 +margin_right = 36.0 +margin_bottom = 14.0 +rect_min_size = Vector2( 36, 0 ) +text = "Address:" +align = 2 + +[node name="ClientAddress" type="LineEdit" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerClient"] +margin_left = 40.0 +margin_right = 160.0 +margin_bottom = 19.0 +rect_min_size = Vector2( 120, 0 ) +align = 1 +caret_blink = true + +[node name="ClientDisConnect" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer/ContainerClient"] +margin_left = 164.0 +margin_right = 211.0 +margin_bottom = 19.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_bottom = 108.0 + +[node name="HideAddress" type="CheckBox" parent="CenterContainer/PanelContainer/VBoxContainer/HBoxContainer"] +margin_right = 82.0 +margin_bottom = 24.0 +text = "Hide Address" + +[node name="Label" type="Label" parent="CenterContainer/PanelContainer/VBoxContainer/HBoxContainer"] +margin_left = 86.0 +margin_top = 7.0 +margin_right = 173.0 +margin_bottom = 16.0 +custom_colors/font_color = Color( 0.6, 0.6, 0.6, 1 ) +text = "(for streamers etc.)" + +[node name="HSeparator2" type="HSeparator" parent="CenterContainer/PanelContainer/VBoxContainer"] +margin_top = 112.0 +margin_right = 211.0 +margin_bottom = 116.0 + +[node name="Quit" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer"] +margin_top = 120.0 +margin_right = 211.0 +margin_bottom = 137.0 +rect_min_size = Vector2( 0, 17 ) + +[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/PanelContainer/VBoxContainer/Quit"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -105.5 +margin_top = -5.0 +margin_right = 105.5 +margin_bottom = 5.0 +mouse_filter = 1 +bbcode_enabled = true +bbcode_text = "[center]Quit Game [color=#999](Alt+F4)[/color][/center]" +text = "Quit Game (Alt+F4)" +fit_content_height = true +scroll_active = false +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Return" type="Button" parent="CenterContainer/PanelContainer/VBoxContainer"] +margin_top = 141.0 +margin_right = 211.0 +margin_bottom = 158.0 +rect_min_size = Vector2( 0, 17 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="RichTextLabel" type="RichTextLabel" parent="CenterContainer/PanelContainer/VBoxContainer/Return"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -105.5 +margin_top = -5.0 +margin_right = 105.5 +margin_bottom = 5.0 +mouse_filter = 1 +bbcode_enabled = true +bbcode_text = "[center]Return to Game [color=#999](Esc)[/color][/center]" +text = "Return to Game (Esc)" +fit_content_height = true +scroll_active = false +__meta__ = { +"_edit_use_anchors_": false +} +[connection signal="pressed" from="CenterContainer/PanelContainer/VBoxContainer/ContainerServer/ServerStartStop" to="." method="_on_ServerStartStop_pressed"] +[connection signal="pressed" from="CenterContainer/PanelContainer/VBoxContainer/ContainerClient/ClientDisConnect" to="." method="_on_ClientDisConnect_pressed"] +[connection signal="toggled" from="CenterContainer/PanelContainer/VBoxContainer/HBoxContainer/HideAddress" to="." method="_on_HideAddress_toggled"] +[connection signal="pressed" from="CenterContainer/PanelContainer/VBoxContainer/Quit" to="." method="_on_Quit_pressed"] +[connection signal="pressed" from="CenterContainer/PanelContainer/VBoxContainer/Return" to="." method="_on_Return_pressed"] diff --git a/scene/GameScene.tscn b/scene/GameScene.tscn new file mode 100644 index 0000000..cee58f2 --- /dev/null +++ b/scene/GameScene.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://scene/EscapeMenu.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/Cursor.cs" type="Script" id=2] +[ext_resource path="res://src/Game.cs" type="Script" id=3] +[ext_resource path="res://gfx/cursor.png" type="Texture" id=4] +[ext_resource path="res://scene/Player.tscn" type="PackedScene" id=5] +[ext_resource path="res://scene/Block.tscn" type="PackedScene" id=6] + +[node name="Game" type="Node"] +script = ExtResource( 3 ) +Player = ExtResource( 5 ) +Block = ExtResource( 6 ) + +[node name="HUD" type="CanvasLayer" parent="."] + +[node name="Cursor" type="Node2D" parent="HUD"] +pause_mode = 2 +z_index = 1 +script = ExtResource( 2 ) + +[node name="Sprite" type="Sprite" parent="HUD/Cursor"] +texture = ExtResource( 4 ) + +[node name="EscapeMenu" parent="HUD" instance=ExtResource( 1 )] +pause_mode = 2 +visible = false diff --git a/Player.tscn b/scene/Player.tscn similarity index 81% rename from Player.tscn rename to scene/Player.tscn index 0f070aa..26e90bb 100644 --- a/Player.tscn +++ b/scene/Player.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://Camera.cs" type="Script" id=1] +[ext_resource path="res://src/Camera.cs" type="Script" id=1] [ext_resource path="res://gfx/player.png" type="Texture" id=2] -[ext_resource path="res://Player.cs" type="Script" id=3] +[ext_resource path="res://src/Player.cs" type="Script" id=3] [sub_resource type="CircleShape2D" id=1] radius = 8.0 diff --git a/Camera.cs b/src/Camera.cs similarity index 90% rename from Camera.cs rename to src/Camera.cs index 65f4cea..bd3b53e 100644 --- a/Camera.cs +++ b/src/Camera.cs @@ -6,7 +6,7 @@ public class Camera : Camera2D public override void _EnterTree() { - Cursor = GetViewport().GetNode("Cursor"); + // Cursor = GetViewport().GetNode("Cursor"); } public override void _Process(float delta) diff --git a/Cursor.cs b/src/Cursor.cs similarity index 100% rename from Cursor.cs rename to src/Cursor.cs diff --git a/src/EscapeMenu.cs b/src/EscapeMenu.cs new file mode 100644 index 0000000..4e40430 --- /dev/null +++ b/src/EscapeMenu.cs @@ -0,0 +1,80 @@ +using Godot; + +public class EscapeMenu : Container +{ + [Export] public int DefaultPort { get; set; } = 25565; + [Export] public string DefaultAddress { get; set; } = "localhost"; + + [Export] public NodePath StatusPath { get; set; } + [Export] public NodePath ServerStartStopPath { get; set; } + [Export] public NodePath ServerPortPath { get; set; } + [Export] public NodePath ClientDisConnectPath { get; set; } + [Export] public NodePath ClientAddressPath { get; set; } + [Export] public NodePath ReturnPath { get; set; } + + public Label Status { get; private set; } + public Button ServerStartStop { get; private set; } + public LineEdit ServerPort { get; private set; } + public Button ClientDisConnect { get; private set; } + public LineEdit ClientAddress { get; private set; } + public Button Return { get; private set; } + + public override void _EnterTree() + { + Status = GetNode