mirror of
https://github.com/Yadciel1/2048-Shooter.git
synced 2024-11-14 01:51:20 +01:00
93 lines
2.2 KiB
Plaintext
93 lines
2.2 KiB
Plaintext
[gd_scene load_steps=6 format=2]
|
|
|
|
[ext_resource path="res://Font/super-legend-boy-font/SuperLegendBoy-4w8Y.ttf" type="DynamicFontData" id=1]
|
|
[ext_resource path="res://retrowave.png" type="Texture" id=2]
|
|
|
|
[sub_resource type="GDScript" id=2]
|
|
script/source = "extends Node2D
|
|
|
|
var score_file = \"user://highscore_2048Shooter.save\"
|
|
# Declare member variables here. Examples:
|
|
# var a = 2
|
|
# var b = \"text\"
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
load_score()
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
#func _process(delta):
|
|
# pass
|
|
|
|
|
|
func _on_Start_pressed():
|
|
get_tree().change_scene(\"res://Main Scenes/Game.tscn\")
|
|
pass # Replace with function body.
|
|
|
|
|
|
func load_score():
|
|
var f = File.new()
|
|
if f.file_exists(score_file):
|
|
$Control/Score.visible = true
|
|
f.open(score_file, File.READ)
|
|
$Control/Score.text = \"Score: \" + f.get_var() as String
|
|
f.close()
|
|
else:
|
|
$Control/Score.text = '0'
|
|
"
|
|
|
|
[sub_resource type="DynamicFont" id=1]
|
|
font_data = ExtResource( 1 )
|
|
|
|
[sub_resource type="DynamicFont" id=3]
|
|
size = 40
|
|
font_data = ExtResource( 1 )
|
|
|
|
[node name="MainMenu" type="Node2D"]
|
|
script = SubResource( 2 )
|
|
|
|
[node name="Background" type="Sprite" parent="."]
|
|
position = Vector2( 288, 592 )
|
|
scale = Vector2( 0.463768, 0.5 )
|
|
texture = ExtResource( 2 )
|
|
|
|
[node name="Control" type="Control" parent="."]
|
|
anchor_left = 0.5
|
|
anchor_top = 0.5
|
|
anchor_right = 0.5
|
|
anchor_bottom = 0.5
|
|
margin_left = 288.0
|
|
margin_top = 504.0
|
|
margin_right = 328.0
|
|
margin_bottom = 544.0
|
|
|
|
[node name="VBoxContainer" type="VBoxContainer" parent="Control"]
|
|
anchor_left = 0.5
|
|
anchor_top = 0.5
|
|
anchor_right = 0.5
|
|
anchor_bottom = 0.5
|
|
margin_left = -180.0
|
|
margin_top = 244.0
|
|
margin_right = 140.0
|
|
margin_bottom = 396.0
|
|
|
|
[node name="Button" type="Button" parent="Control/VBoxContainer"]
|
|
margin_right = 320.0
|
|
margin_bottom = 70.0
|
|
rect_min_size = Vector2( 0, 70 )
|
|
custom_fonts/font = SubResource( 1 )
|
|
text = "Start"
|
|
|
|
[node name="Score" type="Label" parent="Control"]
|
|
margin_left = -264.0
|
|
margin_top = -424.0
|
|
margin_right = -69.0
|
|
margin_bottom = -368.0
|
|
custom_fonts/font = SubResource( 3 )
|
|
text = "Score: "
|
|
|
|
[connection signal="pressed" from="Control/VBoxContainer/Button" to="." method="_on_Start_pressed"]
|