its game over WIP
This commit is contained in:
@@ -10,7 +10,7 @@ border_width_bottom = 2
|
||||
border_color = Color(0.629675, 0.629675, 0.629674, 1)
|
||||
|
||||
[node name="ConfirmationDialog" type="CanvasLayer"]
|
||||
layer = 128
|
||||
layer = 101
|
||||
|
||||
[node name="ConfirmationDialog" type="PanelContainer" parent="."]
|
||||
anchors_preset = 8
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D noise_tex;
|
||||
uniform float progress : hint_range(0.0, 1.0) = 0.0;
|
||||
uniform float softness : hint_range(0.001, 0.2) = 0.05;
|
||||
|
||||
void fragment() {
|
||||
vec4 img = texture(TEXTURE, UV);
|
||||
float noise = texture(noise_tex, UV).r;
|
||||
float alpha = 1.0 - smoothstep(progress - softness, progress + softness, noise);
|
||||
COLOR = vec4(img.rgb, img.a * alpha);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://n2f3kv6b7k2o
|
||||
@@ -0,0 +1,63 @@
|
||||
extends TextureRect
|
||||
|
||||
@onready var mat := material as ShaderMaterial
|
||||
|
||||
signal reveal_done
|
||||
signal hide_done
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
||||
#Hiding
|
||||
hide()
|
||||
|
||||
#Setting up shader
|
||||
randomize()
|
||||
#Noise setup
|
||||
var noise := FastNoiseLite.new()
|
||||
noise.noise_type = FastNoiseLite.TYPE_SIMPLEX
|
||||
noise.frequency = 20.0
|
||||
noise.seed = randi()
|
||||
|
||||
var noise_tex := NoiseTexture2D.new()
|
||||
noise_tex.noise = noise
|
||||
noise_tex.width = 1920
|
||||
noise_tex.height = 1080
|
||||
noise_tex.seamless = true
|
||||
|
||||
mat.set_shader_parameter("noise_tex", noise_tex)
|
||||
|
||||
|
||||
#Revealing game over in a noise spray
|
||||
func reveal_spray():
|
||||
|
||||
show()
|
||||
mat.set_shader_parameter("progress", 0.0)
|
||||
|
||||
var tween = create_tween()
|
||||
tween.tween_method(set_progress, 0.0, 1.0, 3.0) \
|
||||
.set_trans(Tween.TRANS_SINE) \
|
||||
.set_ease(Tween.EASE_OUT)
|
||||
|
||||
await tween.finished
|
||||
reveal_done.emit()
|
||||
|
||||
|
||||
#hiding game over in a hiding spray
|
||||
func hide_spray():
|
||||
|
||||
mat.set_shader_parameter("progress", 1.0)
|
||||
|
||||
var tween = create_tween()
|
||||
tween.tween_method(set_progress, 1.0, 0.0, 3.0) \
|
||||
.set_trans(Tween.TRANS_SINE) \
|
||||
.set_ease(Tween.EASE_OUT)
|
||||
|
||||
await tween.finished
|
||||
hide()
|
||||
hide_done.emit()
|
||||
|
||||
|
||||
#Progressing the reveal/hide
|
||||
func set_progress(value: float):
|
||||
mat.set_shader_parameter("progress", value)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cjft0c0ui8yhs
|
||||
@@ -0,0 +1,33 @@
|
||||
extends Control
|
||||
|
||||
@onready var background = $Background
|
||||
@onready var back_to_menu = $UI/HBoxContainer/BackToMainMenu
|
||||
@onready var reload_checkpoint = $UI/HBoxContainer/ReloadCheckpoint
|
||||
@onready var message = $UI/Message
|
||||
@onready var animation_player = $AnimationPlayer
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
||||
#Hiding everything
|
||||
hide()
|
||||
for node in [background, back_to_menu, reload_checkpoint, message]:
|
||||
node.hide()
|
||||
|
||||
|
||||
|
||||
#Reveals the game over screen
|
||||
func reveal():
|
||||
|
||||
#Reveals the background image first
|
||||
show()
|
||||
background.show()
|
||||
background.reveal_spray()
|
||||
await background.reveal_done
|
||||
|
||||
#Reveals the text and buttons afterwards
|
||||
for node in [message, back_to_menu, reload_checkpoint]:
|
||||
node.modulate.a = 0.0
|
||||
node.show()
|
||||
animation_player.play("fade_in")
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://bru53a1mvu0t2
|
||||
+10
-4
@@ -3,6 +3,8 @@ extends CanvasLayer
|
||||
@onready var next = $UI/SkipContainer/NextButton
|
||||
@onready var confirmation_mask = $ConfirmationMask
|
||||
|
||||
@onready var its_game_over = $ITSGameOverControl
|
||||
|
||||
#Signals for progressing through slides
|
||||
signal next_request
|
||||
signal next_slide
|
||||
@@ -52,11 +54,14 @@ var resolution_list: Dictionary = {
|
||||
func _ready() -> void:
|
||||
|
||||
#Connecting signals
|
||||
#Next Signals
|
||||
#GameOver Signals
|
||||
|
||||
|
||||
#Next Signals
|
||||
next.pressed.connect(_on_next_pressed)
|
||||
self.connect("next_request", _on_next_request)
|
||||
|
||||
#Menu Signals
|
||||
#Menu Signals
|
||||
$UI/UpperContainer/Menu.pressed.connect(_on_menu_pressed)
|
||||
|
||||
$UI/Menu/MarginContainer/VBoxContainer/Resume.pressed.connect(_on_resume_pressed)
|
||||
@@ -71,13 +76,13 @@ func _ready() -> void:
|
||||
$UI/Settings/MarginContainer/VBoxContainer/Control/Back.pressed.connect(_on_back_pressed)
|
||||
$UI/Settings/MarginContainer/VBoxContainer/Control/BackTitle.pressed.connect(_on_back_title_pressed)
|
||||
|
||||
#Save Slots Signals
|
||||
#Save Slots Signals
|
||||
$UI/Save/MarginContainer/VBoxContainer/SaveSlot1.pressed.connect(func(): _on_save_slot_pressed(1))
|
||||
$UI/Save/MarginContainer/VBoxContainer/SaveSlot2.pressed.connect(func(): _on_save_slot_pressed(2))
|
||||
$UI/Save/MarginContainer/VBoxContainer/SaveSlot3.pressed.connect(func(): _on_save_slot_pressed(3))
|
||||
$UI/Save/MarginContainer/VBoxContainer/SaveSlot4.pressed.connect(func(): _on_save_slot_pressed(4))
|
||||
|
||||
#Load Slots Signals
|
||||
#Load Slots Signals
|
||||
$UI/Load/MarginContainer/VBoxContainer/LoadSlot1.pressed.connect(func(): _on_load_slot_pressed(1))
|
||||
$UI/Load/MarginContainer/VBoxContainer/LoadSlot2.pressed.connect(func(): _on_load_slot_pressed(2))
|
||||
$UI/Load/MarginContainer/VBoxContainer/LoadSlot3.pressed.connect(func(): _on_load_slot_pressed(3))
|
||||
@@ -322,3 +327,4 @@ func _on_resolution_selected(index: int):
|
||||
DisplayServer.window_set_size(resolution_size)
|
||||
await get_tree().process_frame #Waits process_frame to avoid bugs
|
||||
DisplayServer.window_set_position(top_left)
|
||||
|
||||
|
||||
+155
-2
@@ -1,8 +1,12 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dy40jygog8t3k"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://dy40jygog8t3k"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c0q67t6m1i4dl" path="res://Scenes/UI/ui.gd" id="1_mg12k"]
|
||||
[ext_resource type="FontFile" uid="uid://dv8ppra5tgn1t" path="res://Art/Fonts/PixelatedEleganceRegular-ovyAA.ttf" id="2_vb7na"]
|
||||
[ext_resource type="Texture2D" uid="uid://l7786mlmvet8" path="res://Art/UI/menu_gear.png" id="3_ibj64"]
|
||||
[ext_resource type="Texture2D" uid="uid://ocg21oes1wsk" path="res://Art/Rooms/screening_room/its_game_over.png" id="4_1c2ca"]
|
||||
[ext_resource type="Script" uid="uid://bru53a1mvu0t2" path="res://Scenes/UI/its_game_over_control.gd" id="4_duuxe"]
|
||||
[ext_resource type="Shader" uid="uid://n2f3kv6b7k2o" path="res://Scenes/UI/its_game_over.gdshader" id="5_duuxe"]
|
||||
[ext_resource type="Script" uid="uid://cjft0c0ui8yhs" path="res://Scenes/UI/its_game_over_background.gd" id="6_jfwrg"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fo2i3"]
|
||||
border_width_left = 2
|
||||
@@ -19,8 +23,90 @@ default_font = ExtResource("2_vb7na")
|
||||
default_font_size = 16
|
||||
OptionButton/fonts/font = ExtResource("2_vb7na")
|
||||
|
||||
[sub_resource type="Theme" id="Theme_mbl0m"]
|
||||
Button/font_sizes/font_size = 30
|
||||
Button/fonts/font = ExtResource("2_vb7na")
|
||||
RichTextLabel/fonts/normal_font = ExtResource("2_vb7na")
|
||||
|
||||
[sub_resource type="Animation" id="Animation_duuxe"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("HBoxContainer/ReloadCheckpoint:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("HBoxContainer/BackToMainMenu:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_jfwrg"]
|
||||
resource_name = "fade_in"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Message:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("HBoxContainer/ReloadCheckpoint:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("HBoxContainer/BackToMainMenu:modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"times": PackedFloat32Array(0, 1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mbl0m"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_duuxe"),
|
||||
&"fade_in": SubResource("Animation_jfwrg")
|
||||
}
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_duuxe"]
|
||||
shader = ExtResource("5_duuxe")
|
||||
shader_parameter/progress = 0.0
|
||||
shader_parameter/softness = 0.05
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" node_paths=PackedStringArray("text_slider", "auto_slider", "text_counter", "auto_counter", "autoplay", "auto_mask", "display_button", "resolution_button")]
|
||||
layer = 127
|
||||
layer = 100
|
||||
script = ExtResource("1_mg12k")
|
||||
text_slider = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed/TextSlider")
|
||||
auto_slider = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed/AutoSlider")
|
||||
@@ -689,3 +775,70 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_force_pass_scroll_events = false
|
||||
color = Color(0, 0, 0, 0.784314)
|
||||
|
||||
[node name="ITSGameOverControl" type="Control" parent="."]
|
||||
z_index = 12
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme = SubResource("Theme_mbl0m")
|
||||
script = ExtResource("4_duuxe")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="ITSGameOverControl"]
|
||||
root_node = NodePath("../UI")
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_mbl0m")
|
||||
}
|
||||
|
||||
[node name="Background" type="TextureRect" parent="ITSGameOverControl"]
|
||||
material = SubResource("ShaderMaterial_duuxe")
|
||||
layout_mode = 0
|
||||
offset_right = 1920.0
|
||||
offset_bottom = 1080.0
|
||||
texture = ExtResource("4_1c2ca")
|
||||
script = ExtResource("6_jfwrg")
|
||||
|
||||
[node name="UI" type="VBoxContainer" parent="ITSGameOverControl"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -625.0
|
||||
offset_top = -175.0
|
||||
offset_right = 625.0
|
||||
offset_bottom = 175.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 100
|
||||
alignment = 1
|
||||
|
||||
[node name="Message" type="RichTextLabel" parent="ITSGameOverControl/UI"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
custom_minimum_size = Vector2(200, 150)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/normal_font_size = 100
|
||||
bbcode_enabled = true
|
||||
text = "[color=dark_red]IT HAS YOU...[/color]"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="ITSGameOverControl/UI"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 50
|
||||
alignment = 1
|
||||
|
||||
[node name="ReloadCheckpoint" type="Button" parent="ITSGameOverControl/UI/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(600, 100)
|
||||
layout_mode = 2
|
||||
text = "RELOAD LATEST CHECKPOINT"
|
||||
|
||||
[node name="BackToMainMenu" type="Button" parent="ITSGameOverControl/UI/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(600, 100)
|
||||
layout_mode = 2
|
||||
text = "BACK TO MAIN MENU"
|
||||
|
||||
Reference in New Issue
Block a user