-
Notifications
You must be signed in to change notification settings - Fork 0
/
HUD.gd
46 lines (33 loc) · 1.04 KB
/
HUD.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
extends CanvasLayer
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
var powerUpBar_EmptyTexture = preload("res://images/power-level-empty.png")
var powerUpBar_FullTexture = preload("res://images/power-level-full.png")
func _ready():
# Called every time the node is added to the scene.
# Initialization here
pass
func _process(delta):
pass
func updatePowerBarLevel( powerBarLevel ):
if powerBarLevel > 0 :
$Sprite0.set_texture(powerUpBar_FullTexture)
else:
$Sprite0.set_texture(powerUpBar_EmptyTexture)
if powerBarLevel > 1:
$Sprite1.set_texture(powerUpBar_FullTexture)
else:
$Sprite1.set_texture(powerUpBar_EmptyTexture)
if powerBarLevel > 2:
$Sprite2.set_texture(powerUpBar_FullTexture)
else:
$Sprite2.set_texture(powerUpBar_EmptyTexture)
if powerBarLevel > 3:
$Sprite3.set_texture(powerUpBar_FullTexture)
else:
$Sprite3.set_texture(powerUpBar_EmptyTexture)
if powerBarLevel >4:
$Sprite4.set_texture(powerUpBar_FullTexture)
else:
$Sprite4.set_texture(powerUpBar_EmptyTexture)