mirror of
https://github.com/Yadciel1/2048-Shooter.git
synced 2024-11-08 23:21:22 +01:00
139 lines
3.5 KiB
Plaintext
139 lines
3.5 KiB
Plaintext
[gd_scene load_steps=9 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="StyleBoxFlat" id=6]
|
|
bg_color = Color( 0, 0.0235294, 0.647059, 1 )
|
|
border_width_left = 5
|
|
border_width_top = 5
|
|
border_width_right = 5
|
|
border_width_bottom = 5
|
|
border_color = Color( 0, 0, 0, 1 )
|
|
border_blend = true
|
|
corner_radius_top_left = 10
|
|
corner_radius_top_right = 10
|
|
corner_radius_bottom_right = 10
|
|
corner_radius_bottom_left = 10
|
|
shadow_size = 4
|
|
shadow_offset = Vector2( 2, 2 )
|
|
|
|
[sub_resource type="StyleBoxFlat" id=7]
|
|
bg_color = Color( 0, 0.0235294, 0.647059, 1 )
|
|
border_width_left = 5
|
|
border_width_top = 5
|
|
border_width_right = 5
|
|
border_width_bottom = 5
|
|
border_color = Color( 0, 0, 0, 1 )
|
|
border_blend = true
|
|
corner_radius_top_left = 10
|
|
corner_radius_top_right = 10
|
|
corner_radius_bottom_right = 10
|
|
corner_radius_bottom_left = 10
|
|
|
|
[sub_resource type="StyleBoxFlat" id=5]
|
|
bg_color = Color( 0, 0.0235294, 1, 1 )
|
|
border_width_left = 5
|
|
border_width_top = 5
|
|
border_width_right = 5
|
|
border_width_bottom = 5
|
|
border_color = Color( 0, 0, 0, 1 )
|
|
border_blend = true
|
|
corner_radius_top_left = 10
|
|
corner_radius_top_right = 10
|
|
corner_radius_bottom_right = 10
|
|
corner_radius_bottom_left = 10
|
|
shadow_size = 4
|
|
shadow_offset = Vector2( 2, 2 )
|
|
|
|
[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 )
|
|
custom_styles/hover = SubResource( 6 )
|
|
custom_styles/pressed = SubResource( 7 )
|
|
custom_styles/normal = SubResource( 5 )
|
|
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"]
|