2048-Shooter/Objects/Overlay.tscn
Yadciel 13394479bd SomeUpdate
Slots can update, other scaling
2022-11-28 12:58:12 +01:00

75 lines
1.7 KiB
Plaintext

[gd_scene load_steps=5 format=2]
[ext_resource path="res://Font/super-legend-boy-font/SuperLegendBoy-4w8Y.ttf" type="DynamicFontData" id=1]
[sub_resource type="GDScript" id=1]
script/source = "extends Control
onready var pBar = $CanvasLayer/ProgressBar
signal full_bar
signal score
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if ($CanvasLayer/Score.text as int % 100) == 0:
emit_signal(\"score\")
if pBar.value == pBar.max_value:
var value = 5
emit_signal(\"full_bar\", value)
pBar.value = 0
pBar.max_value *= 1.2
pass
func on_Death_listed(value):
pBar.value += value
var score = $CanvasLayer/Score.text as int
$CanvasLayer/Score.text = (score+1) as String
"
[sub_resource type="DynamicFont" id=2]
font_data = ExtResource( 1 )
[sub_resource type="DynamicFont" id=3]
size = 24
font_data = ExtResource( 1 )
[node name="Overlay" type="Control" groups=["XP"]]
anchor_right = 1.0
anchor_bottom = 1.0
margin_bottom = -1040.0
grow_horizontal = 2
grow_vertical = 2
script = SubResource( 1 )
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="ProgressBar" type="ProgressBar" parent="CanvasLayer"]
modulate = Color( 0, 1, 0.972549, 1 )
anchor_left = 0.5
anchor_right = 0.5
margin_left = -144.0
margin_top = 48.0
margin_right = 48.0
margin_bottom = 67.0
rect_scale = Vector2( 1.5, 1.5 )
custom_fonts/font = SubResource( 2 )
max_value = 16.0
[node name="Score" type="Label" parent="CanvasLayer"]
margin_left = 288.0
margin_top = 14.0
margin_right = 328.0
margin_bottom = 42.0
grow_horizontal = 2
grow_vertical = 2
custom_fonts/font = SubResource( 3 )
text = "0"
align = 1
valign = 1