prototype vibe
This commit is contained in:
21
scenes/menu/game_over_overlay.gd
Normal file
21
scenes/menu/game_over_overlay.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var label: Label = $Center/VBox/Label
|
||||
@onready var button: Button = $Center/VBox/Button
|
||||
|
||||
func _ready() -> void:
|
||||
visible = false
|
||||
button.pressed.connect(_on_button)
|
||||
|
||||
func show_overlay(wave: int) -> void:
|
||||
label.text = "GAME OVER — Welle %d erreicht" % wave
|
||||
visible = true
|
||||
|
||||
func _on_button() -> void:
|
||||
GameState.reset()
|
||||
PlayerData.reset_run()
|
||||
EnemyData.entities.clear()
|
||||
BossData.entities.clear()
|
||||
PortalData.entities.clear()
|
||||
TavernData.entities.clear()
|
||||
get_tree().change_scene_to_file("res://scenes/menu/main_menu.tscn")
|
||||
1
scenes/menu/game_over_overlay.gd.uid
Normal file
1
scenes/menu/game_over_overlay.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dm00anoh5wtyu
|
||||
41
scenes/menu/game_over_overlay.tscn
Normal file
41
scenes/menu/game_over_overlay.tscn
Normal file
@@ -0,0 +1,41 @@
|
||||
[gd_scene format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/menu/game_over_overlay.gd" id="1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.2, 0.2, 0.25, 0.9)
|
||||
border_width_bottom = 2
|
||||
border_width_left = 2
|
||||
border_width_right = 2
|
||||
border_width_top = 2
|
||||
border_color = Color(0.7, 0.7, 0.7, 1)
|
||||
|
||||
[node name="GameOverOverlay" type="CanvasLayer"]
|
||||
layer = 10
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color(0, 0, 0, 0.75)
|
||||
|
||||
[node name="Center" type="CenterContainer" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="Center"]
|
||||
custom_minimum_size = Vector2(400, 0)
|
||||
theme_override_constants/separation = 30
|
||||
|
||||
[node name="Label" type="Label" parent="Center/VBox"]
|
||||
text = "GAME OVER"
|
||||
horizontal_alignment = 1
|
||||
theme_override_font_sizes/font_size = 48
|
||||
theme_override_colors/font_color = Color(1, 0.3, 0.3, 1)
|
||||
|
||||
[node name="Button" type="Button" parent="Center/VBox"]
|
||||
custom_minimum_size = Vector2(0, 48)
|
||||
text = "Zurück zum Menü"
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
32
scenes/menu/main_menu.gd
Normal file
32
scenes/menu/main_menu.gd
Normal file
@@ -0,0 +1,32 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var singleplayer_button: Button = $Center/VBox/SingleplayerButton
|
||||
@onready var host_button: Button = $Center/VBox/HostButton
|
||||
@onready var join_button: Button = $Center/VBox/JoinButton
|
||||
@onready var quit_button: Button = $Center/VBox/QuitButton
|
||||
|
||||
func _ready() -> void:
|
||||
singleplayer_button.pressed.connect(_on_singleplayer)
|
||||
host_button.pressed.connect(_on_host)
|
||||
join_button.pressed.connect(_on_join)
|
||||
quit_button.pressed.connect(_on_quit)
|
||||
host_button.disabled = true
|
||||
join_button.disabled = true
|
||||
|
||||
func _on_singleplayer() -> void:
|
||||
GameState.reset()
|
||||
PlayerData.reset_run()
|
||||
EnemyData.entities.clear()
|
||||
BossData.entities.clear()
|
||||
PortalData.entities.clear()
|
||||
TavernData.entities.clear()
|
||||
get_tree().change_scene_to_file("res://scenes/world/world.tscn")
|
||||
|
||||
func _on_host() -> void:
|
||||
pass
|
||||
|
||||
func _on_join() -> void:
|
||||
pass
|
||||
|
||||
func _on_quit() -> void:
|
||||
get_tree().quit()
|
||||
1
scenes/menu/main_menu.gd.uid
Normal file
1
scenes/menu/main_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b4m6byh4k2mg7
|
||||
57
scenes/menu/main_menu.tscn
Normal file
57
scenes/menu/main_menu.tscn
Normal file
@@ -0,0 +1,57 @@
|
||||
[gd_scene format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/menu/main_menu.gd" id="1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
|
||||
bg_color = Color(0.2, 0.2, 0.25, 0.9)
|
||||
border_width_bottom = 2
|
||||
border_width_left = 2
|
||||
border_width_right = 2
|
||||
border_width_top = 2
|
||||
border_color = Color(0.7, 0.7, 0.7, 1)
|
||||
|
||||
[node name="MainMenu" type="CanvasLayer"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
color = Color(0.08, 0.08, 0.12, 1)
|
||||
|
||||
[node name="Center" type="CenterContainer" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="Center"]
|
||||
custom_minimum_size = Vector2(320, 0)
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="Title" type="Label" parent="Center/VBox"]
|
||||
text = "MMO"
|
||||
horizontal_alignment = 1
|
||||
theme_override_font_sizes/font_size = 64
|
||||
|
||||
[node name="Spacer" type="Control" parent="Center/VBox"]
|
||||
custom_minimum_size = Vector2(0, 40)
|
||||
|
||||
[node name="SingleplayerButton" type="Button" parent="Center/VBox"]
|
||||
custom_minimum_size = Vector2(0, 48)
|
||||
text = "Singleplayer"
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
|
||||
[node name="HostButton" type="Button" parent="Center/VBox"]
|
||||
custom_minimum_size = Vector2(0, 48)
|
||||
text = "Host (bald)"
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
|
||||
[node name="JoinButton" type="Button" parent="Center/VBox"]
|
||||
custom_minimum_size = Vector2(0, 48)
|
||||
text = "Join (bald)"
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
|
||||
[node name="QuitButton" type="Button" parent="Center/VBox"]
|
||||
custom_minimum_size = Vector2(0, 48)
|
||||
text = "Quit"
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
|
||||
Reference in New Issue
Block a user