finish screen
This commit is contained in:
parent
96a872ff36
commit
e22a34f086
11 changed files with 189 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=29 format=3 uid="uid://by5cq6m32hbor"]
|
||||
[gd_scene load_steps=30 format=3 uid="uid://by5cq6m32hbor"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dv401srtwuvtg" path="res://icon.svg" id="1_6v0xc"]
|
||||
[ext_resource type="Script" uid="uid://bhh76i4a51brf" path="res://Florian/Map/oktoberfest.gd" id="1_20xaa"]
|
||||
|
|
@ -20,6 +20,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://ctcspqlxrw22q" path="res://Florian/PhysicsProps/PhysicsBarrel.tscn" id="13_ijkca"]
|
||||
[ext_resource type="PackedScene" uid="uid://ow35tpunk744" path="res://Florian/PhysicsProps/physics_beer.tscn" id="18_3uiso"]
|
||||
[ext_resource type="PackedScene" uid="uid://ci05g3ilu86xl" path="res://Nikita/pause_menu.tscn" id="20_mmnkp"]
|
||||
[ext_resource type="PackedScene" uid="uid://dl42xs7anteub" path="res://Nikita/finish_screen.tscn" id="21_mmnkp"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_g561u"]
|
||||
albedo_texture = ExtResource("1_tre0f")
|
||||
|
|
@ -390,6 +391,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
|||
|
||||
[node name="PauseMenu" parent="." instance=ExtResource("20_mmnkp")]
|
||||
|
||||
[node name="FinishScreen" parent="." instance=ExtResource("21_mmnkp")]
|
||||
|
||||
[connection signal="interact" from="Stage/Interactable" to="Stage/Pyro" method="_turn_on_off"]
|
||||
[connection signal="interact" from="Stage/Interactable" to="Stage/Pyro2" method="_turn_on_off"]
|
||||
[connection signal="interact" from="Stage/Interactable" to="Stage/Pyro3" method="_turn_on_off"]
|
||||
|
|
|
|||
|
|
@ -1,30 +1,58 @@
|
|||
extends Node3D
|
||||
|
||||
var paused = false
|
||||
var finished = false
|
||||
var main_scene : PackedScene
|
||||
|
||||
func _ready() -> void:
|
||||
$PauseMenu.hide()
|
||||
$PauseMenu.resume.connect(_on_resume_button_pressed)
|
||||
$PauseMenu.main_menu.connect(_on_menu_button_pressed)
|
||||
$FinishScreen.hide()
|
||||
$FinishScreen.retry.connect(_on_retry_button_pressed)
|
||||
$FinishScreen.exit.connect(_on_exit_button_pressed)
|
||||
main_scene = load("res://Nikita/hub_scene.tscn")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("take_picture"):
|
||||
finish()
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
pause_menu()
|
||||
|
||||
func pause_menu():
|
||||
if paused:
|
||||
$PauseMenu.hide()
|
||||
Engine.time_scale = 1
|
||||
get_tree().paused = false
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
else:
|
||||
$PauseMenu.show()
|
||||
Engine.time_scale = 0
|
||||
get_tree().paused = true
|
||||
paused = !paused
|
||||
|
||||
func finish():
|
||||
if finished:
|
||||
$FinishScreen.hide()
|
||||
get_tree().paused = false
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
else:
|
||||
$FinishScreen.show()
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
get_tree().paused = true
|
||||
finished = !finished
|
||||
|
||||
func _on_resume_button_pressed():
|
||||
pause_menu()
|
||||
|
||||
func _on_menu_button_pressed():
|
||||
pause_menu()
|
||||
get_tree().change_scene_to_packed(main_scene)
|
||||
|
||||
func _on_retry_button_pressed():
|
||||
finish()
|
||||
PictureTakeablesArray.picture_takables.clear()
|
||||
PictureTakeablesArray.picture_spots.clear()
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
func _on_exit_button_pressed():
|
||||
finish()
|
||||
get_tree().change_scene_to_packed(main_scene)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://cge0bfktyd7ka"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://cge0bfktyd7ka"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c8bo7u0yr3cfj" path="res://Nikita/textures/golden_gate_hills_1k.png" id="1_dcn22"]
|
||||
[ext_resource type="PackedScene" uid="uid://c6sjs2nhsigfv" path="res://Nikita/source/ballons.glb" id="1_fqyqv"]
|
||||
[ext_resource type="Script" uid="uid://csuiro5uqp8m7" path="res://Nikita/scripts/balloonfest.gd" id="1_ojto3"]
|
||||
[ext_resource type="PackedScene" uid="uid://crrco762ow56c" path="res://Florian/Player/PlayerRigidbody.tscn" id="2_akthd"]
|
||||
[ext_resource type="PackedScene" uid="uid://ci05g3ilu86xl" path="res://Nikita/pause_menu.tscn" id="4_eb1mq"]
|
||||
[ext_resource type="Texture2D" uid="uid://due4jnf5yb2n0" path="res://Nikita/textures/blanket.png" id="6_2jkgr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dl42xs7anteub" path="res://Nikita/finish_screen.tscn" id="7_xc4lk"]
|
||||
|
||||
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_eb1mq"]
|
||||
panorama = ExtResource("1_dcn22")
|
||||
|
|
@ -16,6 +18,11 @@ sky_material = SubResource("PanoramaSkyMaterial_eb1mq")
|
|||
background_mode = 2
|
||||
sky = SubResource("Sky_ojto3")
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_xc4lk"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_kwais"]
|
||||
albedo_texture = ExtResource("6_2jkgr")
|
||||
|
||||
[node name="Balloonfest" type="Node3D"]
|
||||
script = ExtResource("1_ojto3")
|
||||
|
||||
|
|
@ -32,3 +39,10 @@ transform = Transform3D(50, 0, 0, 0, 50, 0, 0, 0, 50, -4.9729, 0, 0.821295)
|
|||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 24.3581, 1.08998, -30.0003)
|
||||
|
||||
[node name="PauseMenu" parent="." instance=ExtResource("4_eb1mq")]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(0.825044, 0, -0.565068, 0, 1, 0, 0.565068, 0, 0.825044, 1.41077, 0.0204842, -3.57851)
|
||||
mesh = SubResource("PlaneMesh_xc4lk")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_kwais")
|
||||
|
||||
[node name="FinishScreen" parent="." instance=ExtResource("7_xc4lk")]
|
||||
|
|
|
|||
88
Nikita/finish_screen.tscn
Normal file
88
Nikita/finish_screen.tscn
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://dl42xs7anteub"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://sw8aocei0slf" path="res://Nikita/scripts/finish_screen.gd" id="1_pfd8y"]
|
||||
|
||||
[node name="FinishScreen" type="Control"]
|
||||
process_mode = 2
|
||||
layout_mode = 3
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_pfd8y")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 7
|
||||
anchor_left = 0.5
|
||||
anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -147.5
|
||||
offset_top = -144.0
|
||||
offset_right = 147.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="MarginContainer/VBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
color = Color(0.905882, 0.756863, 0.654902, 0.427451)
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 1
|
||||
text = "Score:"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Points" type="Label" parent="MarginContainer/VBoxContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 1
|
||||
text = "999"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/MarginContainer2"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Retry" type="Button" parent="MarginContainer/VBoxContainer/MarginContainer2/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_hover_color = Color(0.596078, 0.596078, 0.596078, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 2
|
||||
text = "Retry"
|
||||
|
||||
[node name="Exit" type="Button" parent="MarginContainer/VBoxContainer/MarginContainer2/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_hover_color = Color(0.596078, 0.596078, 0.596078, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 2
|
||||
text = "Exit
|
||||
"
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MarginContainer2/HBoxContainer2/Retry" to="." method="_on_retry_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MarginContainer2/HBoxContainer2/Exit" to="." method="_on_exit_pressed"]
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
[ext_resource type="Script" uid="uid://dpbldsvv2uovr" path="res://Nikita/scripts/pause_menu.gd" id="1_jsawv"]
|
||||
|
||||
[node name="PauseMenu" type="Control"]
|
||||
process_mode = 2
|
||||
layout_mode = 3
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
|
|
@ -30,14 +31,23 @@ layout_mode = 2
|
|||
|
||||
[node name="Resume" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_hover_color = Color(0.596078, 0.596078, 0.596078, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 2
|
||||
text = "Resume"
|
||||
|
||||
[node name="MainMenu" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_hover_color = Color(0.596078, 0.596078, 0.596078, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 2
|
||||
text = "Menu"
|
||||
|
||||
[node name="Quit" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_hover_color = Color(0.595828, 0.595828, 0.595828, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 2
|
||||
text = "Quit"
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/Resume" to="." method="_on_resume_pressed"]
|
||||
|
|
|
|||
|
|
@ -1,30 +1,56 @@
|
|||
extends Node3D
|
||||
|
||||
var paused = false
|
||||
var finished = false
|
||||
var main_scene : PackedScene
|
||||
|
||||
func _ready() -> void:
|
||||
$PauseMenu.hide()
|
||||
$PauseMenu.resume.connect(_on_resume_button_pressed)
|
||||
$PauseMenu.main_menu.connect(_on_menu_button_pressed)
|
||||
$FinishScreen.hide()
|
||||
$FinishScreen.retry.connect(_on_retry_button_pressed)
|
||||
$FinishScreen.exit.connect(_on_exit_button_pressed)
|
||||
main_scene = load("res://Nikita/hub_scene.tscn")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("take_picture"):
|
||||
finish()
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
pause_menu()
|
||||
|
||||
func pause_menu():
|
||||
if paused:
|
||||
$PauseMenu.hide()
|
||||
Engine.time_scale = 1
|
||||
get_tree().paused = false
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
else:
|
||||
$PauseMenu.show()
|
||||
Engine.time_scale = 0
|
||||
get_tree().paused = true
|
||||
paused = !paused
|
||||
|
||||
func finish():
|
||||
if finished:
|
||||
$FinishScreen.hide()
|
||||
get_tree().paused = false
|
||||
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
|
||||
else:
|
||||
$FinishScreen.show()
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
get_tree().paused = true
|
||||
finished = !finished
|
||||
|
||||
func _on_resume_button_pressed():
|
||||
pause_menu()
|
||||
|
||||
func _on_menu_button_pressed():
|
||||
pause_menu()
|
||||
get_tree().change_scene_to_packed(main_scene)
|
||||
|
||||
func _on_retry_button_pressed():
|
||||
finish()
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
func _on_exit_button_pressed():
|
||||
finish()
|
||||
get_tree().change_scene_to_packed(main_scene)
|
||||
|
|
|
|||
11
Nikita/scripts/finish_screen.gd
Normal file
11
Nikita/scripts/finish_screen.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
extends Control
|
||||
|
||||
signal retry
|
||||
signal exit
|
||||
|
||||
func _on_retry_pressed() -> void:
|
||||
emit_signal("retry")
|
||||
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
emit_signal("exit")
|
||||
1
Nikita/scripts/finish_screen.gd.uid
Normal file
1
Nikita/scripts/finish_screen.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://sw8aocei0slf
|
||||
|
|
@ -15,10 +15,10 @@ func _process(delta: float) -> void:
|
|||
func pause_menu():
|
||||
if paused:
|
||||
$PauseMenu.hide()
|
||||
Engine.time_scale = 1
|
||||
get_tree().paused = false
|
||||
else:
|
||||
$PauseMenu.show()
|
||||
Engine.time_scale = 0
|
||||
get_tree().paused = true
|
||||
paused = !paused
|
||||
|
||||
func _on_resume_button_pressed():
|
||||
|
|
|
|||
BIN
Nikita/textures/blanket.png
Normal file
BIN
Nikita/textures/blanket.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
BIN
Nikita/textures/blanket.png.kra
Normal file
BIN
Nikita/textures/blanket.png.kra
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue