level select on win screen

This commit is contained in:
zoe 2021-10-23 16:32:28 +02:00
parent a88727b2d8
commit d90e99e579
4 changed files with 98 additions and 37 deletions

View file

@ -1,5 +1,9 @@
extends TextureButton
func _ready() -> void:
disabled = true
visible = false
func _on_PlayButton_pressed():
GameStats.restart_level()
disabled = true

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Menu/LevelInfo.gd" type="Script" id=1]
[ext_resource path="res://Menu/Theme.tres" type="Theme" id=2]
@ -6,13 +6,7 @@
[ext_resource path="res://Menu/Buttons/PlayButton.tscn" type="PackedScene" id=6]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.847059, 0.74902, 0.847059, 1 )
[sub_resource type="InputEventAction" id=2]
action = "ui_accept"
[sub_resource type="ShortCut" id=3]
shortcut = SubResource( 2 )
bg_color = Color( 0.6, 0.6, 0.6, 0 )
[node name="LevelInfo" type="PanelContainer"]
anchor_right = 1.0
@ -73,4 +67,3 @@ margin_top = 66.0
margin_right = 32.0
margin_bottom = 98.0
shortcut_in_tooltip = false
shortcut = SubResource( 3 )

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=11 format=2]
[gd_scene load_steps=13 format=2]
[ext_resource path="res://Menu/MenuPage.tscn" type="PackedScene" id=1]
[ext_resource path="res://Menu/LevelInfo.tscn" type="PackedScene" id=1]
[ext_resource path="res://Menu/Buttons/RestartButton.tscn" type="PackedScene" id=2]
[ext_resource path="res://Menu/Theme.tres" type="Theme" id=3]
[ext_resource path="res://Menu/WinScreen.gd" type="Script" id=4]
@ -9,6 +9,15 @@
[ext_resource path="res://Menu/Icons/Home/homeIcon2.png" type="Texture" id=7]
[ext_resource path="res://Menu/Icons/Home/homeIcon3.png" type="Texture" id=8]
[ext_resource path="res://Menu/WinScreenScoreLabel.gd" type="Script" id=9]
[ext_resource path="res://Menu/LevelList.tscn" type="PackedScene" id=10]
[sub_resource type="StyleBoxFlat" id=2]
bg_color = Color( 0.847059, 0.74902, 0.847059, 1 )
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color( 0.454902, 0.337255, 0.607843, 1 )
[sub_resource type="Animation" id=1]
resource_name = "win"
@ -34,47 +43,102 @@ tracks/1/keys = {
"times": PoolRealArray( 0, 1 )
}
[node name="WinScreen" instance=ExtResource( 1 )]
[node name="WinScreen" type="CanvasLayer"]
pause_mode = 2
script = ExtResource( 4 )
[node name="Control" parent="." index="0"]
[node name="Control" type="Control" parent="."]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
focus_mode = 1
theme = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="GridContainer" parent="Control/Panel/CenterContainer" index="0"]
[node name="Panel2" type="Panel" parent="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 12.0
margin_top = 12.0
margin_right = -12.0
margin_bottom = -12.0
custom_styles/panel = SubResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Panel" type="HBoxContainer" parent="Control/Panel2"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="LevelList" parent="Control/Panel2/Panel" instance=ExtResource( 10 )]
margin_left = 0.0
margin_right = 192.0
margin_bottom = 192.0
[node name="CenterContainer" type="CenterContainer" parent="Control/Panel2/Panel"]
margin_left = 196.0
margin_right = 313.0
margin_bottom = 192.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="GridContainer" type="VBoxContainer" parent="Control/Panel2/Panel/CenterContainer"]
margin_left = 15.0
margin_top = 56.0
margin_right = 101.0
margin_bottom = 136.0
[node name="WinScreenScoreLabel" type="Label" parent="Control/Panel2/Panel/CenterContainer/GridContainer"]
margin_right = 117.0
margin_bottom = 18.0
text = "700"
script = ExtResource( 9 )
[node name="Heading" type="Label" parent="Control/Panel2/Panel/CenterContainer/GridContainer"]
margin_top = 22.0
margin_right = 117.0
margin_bottom = 40.0
theme = ExtResource( 3 )
text = "you won!"
[node name="HBoxContainer" type="HBoxContainer" parent="Control/Panel2/Panel/CenterContainer/GridContainer"]
margin_top = 44.0
margin_bottom = 120.0
margin_right = 117.0
margin_bottom = 76.0
[node name="ButtonRow" parent="Control/Panel/CenterContainer/GridContainer" index="1"]
margin_bottom = 54.0
[node name="RestartButton" parent="Control/Panel/CenterContainer/GridContainer/ButtonRow" index="0" instance=ExtResource( 2 )]
margin_left = 9.0
margin_right = 41.0
[node name="RestartButton" parent="Control/Panel2/Panel/CenterContainer/GridContainer/HBoxContainer" instance=ExtResource( 2 )]
margin_bottom = 32.0
[node name="LevelSelectIconButton" parent="Control/Panel/CenterContainer/GridContainer/ButtonRow" index="1" instance=ExtResource( 5 )]
margin_left = 45.0
margin_right = 77.0
[node name="LevelSelectIconButton" parent="Control/Panel2/Panel/CenterContainer/GridContainer/HBoxContainer" instance=ExtResource( 5 )]
margin_left = 36.0
margin_right = 68.0
margin_bottom = 32.0
texture_normal = ExtResource( 6 )
texture_pressed = ExtResource( 8 )
texture_hover = ExtResource( 7 )
[node name="WinScreenScoreLabel" type="Label" parent="Control/Panel/CenterContainer/GridContainer" index="2"]
margin_top = 58.0
margin_right = 86.0
margin_bottom = 76.0
text = "700"
align = 1
script = ExtResource( 9 )
[node name="LevelInfo" parent="Control/Panel2/Panel/CenterContainer/GridContainer" instance=ExtResource( 1 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 80.0
margin_right = 117.0
margin_bottom = 178.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="." index="1"]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/win = SubResource( 1 )
[node name="Congratulations" type="Node2D" parent="." index="2"]
[node name="Congratulations" type="Node2D" parent="."]
position = Vector2( -184, 104 )
[node name="Cogratulations!!!" type="Label" parent="Congratulations" index="0"]
[node name="Cogratulations!!!" type="Label" parent="Congratulations"]
margin_right = 182.0
margin_bottom = 18.0
theme = ExtResource( 3 )
@ -85,10 +149,10 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Congratulations2" type="Node2D" parent="." index="3"]
[node name="Congratulations2" type="Node2D" parent="."]
position = Vector2( 392, 135 )
[node name="you won!" type="Label" parent="Congratulations2" index="0"]
[node name="you won!" type="Label" parent="Congratulations2"]
margin_right = 88.0
margin_bottom = 18.0
theme = ExtResource( 3 )

View file

@ -153,7 +153,7 @@ keystore/release_password=""
one_click_deploy/clear_previous_install=false
version/code=1
version/name="1.0"
package/unique_name="org.godotengine.$genname"
package/unique_name="gay.zoebat.$genname"
package/name=""
package/signed=true
launcher_icons/main_192x192=""