Fixed Bugs; Added Score overview
This commit is contained in:
parent
fdfb6a7d39
commit
6d71780f36
9 changed files with 152 additions and 33 deletions
19
scenes/ScoreOverview/score_overview.gd
Normal file
19
scenes/ScoreOverview/score_overview.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
extends Control
|
||||
|
||||
@onready var score = $VBoxContainer3/VBoxContainer2/ScoreValue
|
||||
@onready var time = $VBoxContainer3/VBoxContainer/TimeValue
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
score.text = str(GLOBAL.points)
|
||||
time.text = str(GLOBAL.time)
|
||||
GLOBAL.resetGame()
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _on_left_button_pressed() -> void:
|
||||
get_parent().loadGrid()
|
||||
72
scenes/ScoreOverview/score_overview.tscn
Normal file
72
scenes/ScoreOverview/score_overview.tscn
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://crnamktl6ltt"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://1nebbd65iyce" path="res://Theme/main.tres" id="1_pyjb5"]
|
||||
[ext_resource type="LabelSettings" uid="uid://cd783ubpcytc8" path="res://Theme/label.tres" id="2_4dys4"]
|
||||
[ext_resource type="Script" path="res://scenes/ScoreOverview/score_overview.gd" id="2_vv54r"]
|
||||
[ext_resource type="LabelSettings" uid="uid://5mlweyjje7c4" path="res://Theme/labelBig.tres" id="4_dfemu"]
|
||||
[ext_resource type="Texture2D" uid="uid://ct4dkk00pyv6v" path="res://assets/Buttons/RotationLeft.png" id="5_xkigm"]
|
||||
|
||||
[node name="ScoreOverview" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 6
|
||||
theme = ExtResource("1_pyjb5")
|
||||
script = ExtResource("2_vv54r")
|
||||
|
||||
[node name="VBoxContainer3" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -166.0
|
||||
offset_top = -182.0
|
||||
offset_right = 166.0
|
||||
offset_bottom = 182.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer3"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Score" type="Label" parent="VBoxContainer3/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Your Score"
|
||||
label_settings = ExtResource("2_4dys4")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ScoreValue" type="Label" parent="VBoxContainer3/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
label_settings = ExtResource("4_dfemu")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer3"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Time" type="Label" parent="VBoxContainer3/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Time Left"
|
||||
label_settings = ExtResource("2_4dys4")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="TimeValue" type="Label" parent="VBoxContainer3/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
label_settings = ExtResource("4_dfemu")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="left_Button" type="Button" parent="VBoxContainer3"]
|
||||
layout_mode = 2
|
||||
action_mode = 0
|
||||
text = "Play Again"
|
||||
icon = ExtResource("5_xkigm")
|
||||
expand_icon = true
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer3/left_Button" to="." method="_on_left_button_pressed"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue