Player died & Round & Respawn

This commit is contained in:
2024-08-09 11:43:03 +08:00
parent cf6b4b0273
commit 6b48561f45
8 changed files with 262 additions and 87 deletions

View File

@ -1,11 +1,21 @@
[gd_scene load_steps=6 format=3 uid="uid://bjhmjrldq4lkt"]
[gd_scene load_steps=9 format=3 uid="uid://bjhmjrldq4lkt"]
[ext_resource type="PackedScene" uid="uid://b3gx0bl43lku3" path="res://Scenes/Player.tscn" id="1_vby0g"]
[ext_resource type="PackedScene" uid="uid://bvll23f5ibd4v" path="res://Scenes/UI/LaunchScreen.tscn" id="2_7o53i"]
[ext_resource type="Script" path="res://Scripts/Launcher.cs" id="2_u5cms"]
[ext_resource type="Script" path="res://Scripts/Logic/Scoreboard.cs" id="3_as2wg"]
[ext_resource type="Script" path="res://Scripts/Logic/World.cs" id="3_xwguj"]
[ext_resource type="PackedScene" uid="uid://bb704b0kpwwkr" path="res://Scenes/UI/PlayerDiedScreen.tscn" id="5_pimes"]
[ext_resource type="PackedScene" uid="uid://c7w5sgq0bshk0" path="res://Scenes/UI/HUD.tscn" id="5_qvun1"]
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_gyspy"]
properties/0/path = NodePath(".:RoundProgress")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath(".:RoundTimeLeft")
properties/1/spawn = true
properties/1/replication_mode = 1
[node name="Node" type="Node"]
[node name="LaunchScreen" parent="." node_paths=PackedStringArray("Launcher") instance=ExtResource("2_7o53i")]
@ -16,14 +26,26 @@ script = ExtResource("2_u5cms")
World = NodePath("../World")
Overlay = NodePath("../OverlayLayer")
[node name="ScoreboardNode" type="Node" parent="."]
script = ExtResource("3_as2wg")
[node name="OverlayLayer" type="CanvasLayer" parent="."]
[node name="Hud" parent="OverlayLayer" node_paths=PackedStringArray("World") instance=ExtResource("5_qvun1")]
World = NodePath("../../World")
[node name="World" type="Node2D" parent="."]
[node name="PlayerDiedScreen" parent="OverlayLayer" instance=ExtResource("5_pimes")]
visible = false
[node name="World" type="Node2D" parent="." node_paths=PackedStringArray("Scoreboard")]
script = ExtResource("3_xwguj")
Scoreboard = NodePath("../ScoreboardNode")
PlayerScene = ExtResource("1_vby0g")
RoundDuration = 10.0
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
root_path = NodePath("../World")
replication_config = SubResource("SceneReplicationConfig_gyspy")
[node name="PlayerSpawner" type="MultiplayerSpawner" parent="."]
_spawnable_scenes = PackedStringArray("res://Scenes/Player.tscn")

View File

@ -1,13 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://c7w5sgq0bshk0"]
[gd_scene load_steps=2 format=3 uid="uid://c7w5sgq0bshk0"]
[ext_resource type="Script" path="res://Scripts/UI/HUD.cs" id="1_2iqqk"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bl2bd"]
bg_color = Color(0.243137, 0.243137, 0.243137, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_it2a4"]
bg_color = Color(0.545098, 0.545098, 0.545098, 1)
[node name="Hud" type="Control"]
layout_mode = 3
anchors_preset = 15
@ -83,17 +77,37 @@ show_percentage = false
[node name="BottomBox" type="VBoxContainer" parent="."]
layout_mode = 0
offset_top = 608.0
offset_right = 1152.0
offset_bottom = 648.0
offset_left = 16.0
offset_top = 592.0
offset_right = 1136.0
offset_bottom = 632.0
alignment = 2
[node name="ProgressBar" type="ProgressBar" parent="BottomBox"]
custom_minimum_size = Vector2(2.08165e-12, 4)
[node name="HBox" type="HBoxContainer" parent="BottomBox"]
layout_mode = 2
[node name="PositionLabel" type="Label" parent="BottomBox/HBox"]
layout_mode = 2
size_flags_horizontal = 3
text = "(0, 0)"
[node name="RoundLabel" type="Label" parent="BottomBox/HBox"]
layout_mode = 2
size_flags_horizontal = 3
text = "Round 1"
horizontal_alignment = 1
[node name="RoundSecondLabel" type="Label" parent="BottomBox/HBox"]
layout_mode = 2
size_flags_horizontal = 3
text = "60.00"
horizontal_alignment = 2
[node name="ProgressBar" type="ProgressBar" parent="BottomBox"]
custom_minimum_size = Vector2(2.08165e-12, 8)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_bl2bd")
theme_override_styles/fill = SubResource("StyleBoxFlat_it2a4")
value = 50.0
rounded = true
allow_greater = true
allow_lesser = true
show_percentage = false

View File

@ -0,0 +1,28 @@
[gd_scene format=3 uid="uid://bb704b0kpwwkr"]
[node name="PlayerDiedScreen" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="CenterContainer" type="CenterContainer" parent="."]
layout_mode = 0
offset_right = 1152.0
offset_bottom = 648.0
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
layout_mode = 2
[node name="Title" type="Label" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 28
text = "You died"
horizontal_alignment = 1
[node name="Caption" type="Label" parent="CenterContainer/VBoxContainer"]
layout_mode = 2
text = "Respawn in Next Round"
horizontal_alignment = 1