forked from team-sg/hero-mark-2
added different timer and life colors for if you have the bonus
This commit is contained in:
parent
f4dda0ab1b
commit
ade77af031
3 changed files with 14 additions and 0 deletions
|
@ -13,6 +13,8 @@ onready var lives_counter = $LivesCounter
|
|||
onready var high_counter = $HighCounter
|
||||
onready var time_counter = $TimeCounter
|
||||
|
||||
export (Color) var bonus_color
|
||||
|
||||
func _ready():
|
||||
Game.time = 0
|
||||
|
||||
|
@ -34,8 +36,18 @@ func _physics_process(delta):
|
|||
##TOUCH UP LATER
|
||||
#Lives counter
|
||||
lives_counter.text = str(Game.lives)
|
||||
#Life bonus color
|
||||
if Game.lives == 2:
|
||||
lives_counter.modulate = bonus_color
|
||||
else:
|
||||
lives_counter.modulate = Color.white
|
||||
#High counter
|
||||
high_counter.text = str("HIGH:") + str("%06d" % Game.high_score)
|
||||
##Timer
|
||||
Game.time += delta
|
||||
time_counter.text = Game.timeify(Game.time)
|
||||
#Time bonus counter
|
||||
if (Game.has_collection_bonus() && Game.time <= Game.get_map().target_time_100) or (!Game.has_collection_bonus() && Game.time <= Game.get_map().target_time_any):
|
||||
time_counter.modulate = bonus_color
|
||||
else:
|
||||
time_counter.modulate = Color.white
|
||||
|
|
|
@ -16,6 +16,7 @@ layer = 100
|
|||
margin_top = 1.0
|
||||
margin_bottom = 1.0
|
||||
script = ExtResource( 6 )
|
||||
bonus_color = Color( 0.478431, 1, 0.47451, 1 )
|
||||
|
||||
[node name="Back" type="Sprite" parent="HUD"]
|
||||
position = Vector2( 128, 95 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue