refining menus and gameplay slightly
This commit is contained in:
35
scenes/menus/pause/pause.gd
Normal file
35
scenes/menus/pause/pause.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends Control
|
||||
|
||||
var scene
|
||||
var button_sound
|
||||
var fade
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
scene = get_tree().current_scene
|
||||
button_sound = $ButtonPress
|
||||
|
||||
fade = self.get_parent().get_node("Fade")
|
||||
fade.visible = true
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func resume():
|
||||
button_sound.play()
|
||||
scene.active = true
|
||||
self.visible = false
|
||||
|
||||
func _on_back_pressed() -> void:
|
||||
resume()
|
||||
|
||||
func _on_options_pressed() -> void:
|
||||
pass
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
var tween := create_tween()
|
||||
tween.parallel().tween_property(fade, "modulate:a", 1, 1).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
|
||||
button_sound.play()
|
||||
await button_sound.finished
|
||||
get_tree().change_scene_to_file("res://scenes/menus/start_menu/title.tscn")
|
||||
1
scenes/menus/pause/pause.gd.uid
Normal file
1
scenes/menus/pause/pause.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://15e0tr7en3iq
|
||||
65
scenes/menus/pause/pause.tscn
Normal file
65
scenes/menus/pause/pause.tscn
Normal file
@@ -0,0 +1,65 @@
|
||||
[gd_scene format=3 uid="uid://dm6jp4gjboooc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://15e0tr7en3iq" path="res://scenes/menus/pause/pause.gd" id="1_8lsyj"]
|
||||
[ext_resource type="AudioStream" uid="uid://podscahsf0d4" path="res://assets/audio/sfx/MenuAccept.wav" id="2_y88h8"]
|
||||
|
||||
[node name="Pause" type="Control" unique_id=1227462733]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_8lsyj")
|
||||
|
||||
[node name="Dim" type="ColorRect" parent="." unique_id=677985495]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0.29411766)
|
||||
|
||||
[node name="BoxContainer" type="BoxContainer" parent="." unique_id=724874690]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -267.0
|
||||
offset_top = -162.5
|
||||
offset_right = 267.0
|
||||
offset_bottom = 162.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
alignment = 1
|
||||
vertical = true
|
||||
|
||||
[node name="Back" type="Button" parent="BoxContainer" unique_id=2010495470]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Resume"
|
||||
|
||||
[node name="Options" type="Button" parent="BoxContainer" unique_id=1573468039]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Options"
|
||||
|
||||
[node name="Exit" type="Button" parent="BoxContainer" unique_id=870296717]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Back To Title
|
||||
"
|
||||
|
||||
[node name="ButtonPress" type="AudioStreamPlayer2D" parent="." unique_id=1518446961]
|
||||
stream = ExtResource("2_y88h8")
|
||||
volume_db = -10.0
|
||||
|
||||
[connection signal="pressed" from="BoxContainer/Back" to="." method="_on_back_pressed"]
|
||||
[connection signal="pressed" from="BoxContainer/Options" to="." method="_on_options_pressed"]
|
||||
[connection signal="pressed" from="BoxContainer/Exit" to="." method="_on_exit_pressed"]
|
||||
@@ -1,9 +1,11 @@
|
||||
extends Control
|
||||
|
||||
var game_mode
|
||||
var stage = 0
|
||||
var word_select
|
||||
var main_buttons
|
||||
var fade
|
||||
var header
|
||||
var word_select_button = preload("res://scenes/objects/ui/word_select_button.tscn")
|
||||
|
||||
func check_text_files(path):
|
||||
@@ -27,6 +29,7 @@ func check_text_files(path):
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
game_mode = null
|
||||
header = self.get_node("Header")
|
||||
fade = self.get_node("Fade")
|
||||
fade.visible = true
|
||||
main_buttons = self.get_node("MainButtons")
|
||||
@@ -44,13 +47,38 @@ func open_word_menu():
|
||||
pass
|
||||
|
||||
func _on_comet_pressed() -> void:
|
||||
header.text = "Select Word Set"
|
||||
stage = 1
|
||||
game_mode = "comet"
|
||||
self.get_node("ButtonPress").play()
|
||||
main_buttons.visible = false
|
||||
word_select.visible = true
|
||||
|
||||
func _on_cascade_pressed() -> void:
|
||||
header.text = "Select Word Set"
|
||||
stage = 1
|
||||
game_mode = "cascade"
|
||||
self.get_node("ButtonPress").play()
|
||||
main_buttons.visible = false
|
||||
word_select.visible = true
|
||||
|
||||
|
||||
func _on_quit_pressed() -> void:
|
||||
$BackgroundMusic.stop()
|
||||
$Bye.play()
|
||||
var tween := create_tween()
|
||||
tween.parallel().tween_property(fade, "modulate:a", 1, 0.5).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
|
||||
await get_tree().create_timer(1.5).timeout
|
||||
get_tree().quit()
|
||||
|
||||
func _input(event):
|
||||
if event is InputEventKey and event.pressed:
|
||||
if event.keycode == KEY_ESCAPE:
|
||||
if stage == 1:
|
||||
header.text = "Select Mode"
|
||||
$Back.play()
|
||||
stage = 0
|
||||
game_mode = null
|
||||
main_buttons.visible = true
|
||||
word_select.visible = false
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
[gd_scene format=3 uid="uid://cb2i4ei3lihbh"]
|
||||
|
||||
[ext_resource type="Shader" path="res://scroll.gdshader" id="1_3oan1"]
|
||||
[ext_resource type="Shader" uid="uid://b4yhwgv8l8djq" path="res://scroll.gdshader" id="1_3oan1"]
|
||||
[ext_resource type="Script" uid="uid://buqy4h8s5nhg7" path="res://scenes/menus/select_mode/select_mode.gd" id="1_avhy0"]
|
||||
[ext_resource type="Texture2D" uid="uid://dew71sa7dwdnc" path="res://textures/tux typing +.png" id="2_3oan1"]
|
||||
[ext_resource type="AudioStream" uid="uid://df31l8x4fxwf0" path="res://assets/audio/music/menus/Mario Kart Wii Music - Menu (Medley) [fN2dJP0WLDQ].mp3" id="3_xhbdh"]
|
||||
[ext_resource type="AudioStream" uid="uid://podscahsf0d4" path="res://assets/audio/sfx/MenuAccept.wav" id="5_32ulc"]
|
||||
[ext_resource type="AudioStream" uid="uid://cv5et4r5063yq" path="res://assets/audio/sfx/OuttaHere.wav" id="6_0p6fv"]
|
||||
[ext_resource type="AudioStream" uid="uid://ckr4pf3etle0p" path="res://assets/audio/sfx/SYS_cancel.ogg" id="7_maffk"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_aeitr"]
|
||||
shader = ExtResource("1_3oan1")
|
||||
@@ -13,6 +15,9 @@ shader_parameter/speed = 0.1
|
||||
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_cqx26"]
|
||||
load_path = "res://.godot/imported/wp2812464.jpg-16426a98baf4dc04320bc61fb53f8deb.ctex"
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_maffk"]
|
||||
font_size = 120
|
||||
|
||||
[node name="Control" type="Control" unique_id=550682840]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
@@ -55,18 +60,19 @@ anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -288.5
|
||||
offset_top = -360.0
|
||||
offset_top = -222.5
|
||||
offset_right = 288.5
|
||||
offset_bottom = 360.0
|
||||
offset_bottom = 461.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="WordSelect" type="VBoxContainer" parent="WordSelectScroll" unique_id=56995036]
|
||||
[node name="WordSelect" type="BoxContainer" parent="WordSelectScroll" unique_id=549402027]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
vertical = true
|
||||
|
||||
[node name="MainButtons" type="BoxContainer" parent="." unique_id=881316051]
|
||||
layout_mode = 1
|
||||
@@ -85,6 +91,7 @@ vertical = true
|
||||
|
||||
[node name="Cascade" type="Button" parent="MainButtons" unique_id=1019308409]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "Fish Cascade
|
||||
"
|
||||
@@ -92,6 +99,7 @@ expand_icon = true
|
||||
|
||||
[node name="Comet" type="Button" parent="MainButtons" unique_id=1352982543]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "Comet Zap
|
||||
"
|
||||
@@ -99,6 +107,7 @@ expand_icon = true
|
||||
|
||||
[node name="Lessons" type="Button" parent="MainButtons" unique_id=1616574107]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "Lessons
|
||||
"
|
||||
@@ -106,26 +115,50 @@ expand_icon = true
|
||||
|
||||
[node name="Options" type="Button" parent="MainButtons" unique_id=249277019]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "Options"
|
||||
expand_icon = true
|
||||
|
||||
[node name="Quit" type="Button" parent="MainButtons" unique_id=1080429911]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "Quit
|
||||
"
|
||||
expand_icon = true
|
||||
|
||||
[node name="Header" type="Label" parent="." unique_id=1583137254]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -352.0
|
||||
offset_top = -440.0
|
||||
offset_right = 352.0
|
||||
offset_bottom = -275.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "Select Mode"
|
||||
label_settings = SubResource("LabelSettings_maffk")
|
||||
|
||||
[node name="BackgroundMusic" type="AudioStreamPlayer2D" parent="." unique_id=1780401057]
|
||||
stream = ExtResource("3_xhbdh")
|
||||
volume_db = -20.0
|
||||
volume_db = -10.0
|
||||
autoplay = true
|
||||
parameters/looping = true
|
||||
|
||||
[node name="ButtonPress" type="AudioStreamPlayer2D" parent="." unique_id=1605257004]
|
||||
stream = ExtResource("5_32ulc")
|
||||
volume_db = -20.0
|
||||
volume_db = -10.0
|
||||
|
||||
[node name="Bye" type="AudioStreamPlayer2D" parent="." unique_id=189986693]
|
||||
stream = ExtResource("6_0p6fv")
|
||||
|
||||
[node name="Back" type="AudioStreamPlayer2D" parent="." unique_id=732973693]
|
||||
stream = ExtResource("7_maffk")
|
||||
|
||||
[node name="Fade" type="ColorRect" parent="." unique_id=1920157134]
|
||||
visible = false
|
||||
@@ -140,3 +173,4 @@ color = Color(0, 0, 0, 1)
|
||||
|
||||
[connection signal="pressed" from="MainButtons/Cascade" to="." method="_on_cascade_pressed"]
|
||||
[connection signal="pressed" from="MainButtons/Comet" to="." method="_on_comet_pressed"]
|
||||
[connection signal="pressed" from="MainButtons/Quit" to="." method="_on_quit_pressed"]
|
||||
|
||||
26
scenes/menus/start_menu/title.gd
Normal file
26
scenes/menus/start_menu/title.gd
Normal file
@@ -0,0 +1,26 @@
|
||||
extends Control
|
||||
|
||||
var fade
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
fade = $Fade
|
||||
fade.visible = true
|
||||
|
||||
var tween := create_tween()
|
||||
tween.parallel().tween_property(fade, "modulate:a", 0, .5).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func _input(event):
|
||||
if event is InputEventKey and event.pressed:
|
||||
if event.keycode == KEY_ESCAPE:
|
||||
$TitleMusic.stop()
|
||||
$Bye.play()
|
||||
var tween := create_tween()
|
||||
tween.parallel().tween_property(fade, "modulate:a", 1, 0.5).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
|
||||
await get_tree().create_timer(1.5).timeout
|
||||
get_tree().quit()
|
||||
1
scenes/menus/start_menu/title.gd.uid
Normal file
1
scenes/menus/start_menu/title.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://fh2cd7vlu5fy
|
||||
@@ -1,11 +1,13 @@
|
||||
[gd_scene format=3 uid="uid://c536b5suvq3ep"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://fh2cd7vlu5fy" path="res://scenes/menus/start_menu/title.gd" id="1_iysul"]
|
||||
[ext_resource type="Shader" uid="uid://b4yhwgv8l8djq" path="res://scroll.gdshader" id="1_kpexm"]
|
||||
[ext_resource type="Texture2D" uid="uid://db557qcd1godx" path="res://textures/scrolbackground.png" id="2_3xoar"]
|
||||
[ext_resource type="Texture2D" uid="uid://dew71sa7dwdnc" path="res://textures/tux typing +.png" id="3_mom7w"]
|
||||
[ext_resource type="Script" uid="uid://cvxtof1igytdj" path="res://scenes/menus/start_menu/start_button.gd" id="4_jd0r5"]
|
||||
[ext_resource type="AudioStream" uid="uid://cphmtgjrvot1n" path="res://assets/audio/music/menus/Discovery (Title Screen) - Sonic Mania [OST] [UZpxOFyEOZY].mp3" id="5_tufir"]
|
||||
[ext_resource type="AudioStream" uid="uid://podscahsf0d4" path="res://assets/audio/sfx/MenuAccept.wav" id="6_uskxy"]
|
||||
[ext_resource type="AudioStream" uid="uid://cv5et4r5063yq" path="res://assets/audio/sfx/OuttaHere.wav" id="8_ggcqs"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_nlc08"]
|
||||
shader = ExtResource("1_kpexm")
|
||||
@@ -55,13 +57,14 @@ shadow_size = 32
|
||||
shadow_color = Color(0.9254902, 0.38039216, 0.6666667, 1)
|
||||
shadow_offset = Vector2(9.8, 5.495)
|
||||
|
||||
[node name="Control" type="Control" unique_id=2056562558]
|
||||
[node name="Title" type="Control" unique_id=2056562558]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_iysul")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="." unique_id=832996317]
|
||||
layout_mode = 1
|
||||
@@ -129,15 +132,15 @@ vertical_alignment = 1
|
||||
|
||||
[node name="TitleMusic" type="AudioStreamPlayer2D" parent="." unique_id=200515057]
|
||||
stream = ExtResource("5_tufir")
|
||||
volume_db = -20.0
|
||||
volume_db = -10.0
|
||||
autoplay = true
|
||||
|
||||
[node name="ButtonPress" type="AudioStreamPlayer2D" parent="." unique_id=878860967]
|
||||
stream = ExtResource("6_uskxy")
|
||||
volume_db = -20.0
|
||||
volume_db = -10.0
|
||||
|
||||
[node name="Fade" type="ColorRect" parent="." unique_id=884781609]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -147,4 +150,7 @@ grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="Bye" type="AudioStreamPlayer2D" parent="." unique_id=819718365]
|
||||
stream = ExtResource("8_ggcqs")
|
||||
|
||||
[connection signal="pressed" from="StartButton" to="StartButton" method="_on_pressed"]
|
||||
|
||||
Reference in New Issue
Block a user