2048-Shooter/Overlay.tscn
2022-11-24 16:00:50 +01:00

60 lines
1.3 KiB
Plaintext

[gd_scene load_steps=2 format=2]
[sub_resource type="GDScript" id=1]
script/source = "extends Control
# Declare member variables here. Examples:
# var a = 2
# var b = \"text\"
onready var pBar = $CanvasLayer/ProgressBar
signal full_bar
# Called when the node enters the scene tree for the first time.
func _ready():
var Enemies = get_tree().get_nodes_in_group(\"Enemy\")
for Enemy in Enemies:
Enemy.connect(\"on_Death\", self, \"on_Death_listed\")
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if pBar.value == pBar.max_value:
var value = 50
emit_signal(\"full_bar\", value)
pBar.value = 0
pBar.max_value += 10
pass
func on_Death_listed(value):
pBar.value += value
"
[node name="Control" 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"]
anchor_left = 0.5
anchor_right = 0.5
margin_left = -144.0
margin_top = 48.0
margin_right = 48.0
margin_bottom = 62.0
rect_scale = Vector2( 1.5, 1.5 )
max_value = 10.0
[node name="Label" type="Label" parent="."]
margin_right = 184.0
margin_bottom = 160.0