refining menus and gameplay slightly
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user