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 high_counter = $HighCounter
|
||||||
onready var time_counter = $TimeCounter
|
onready var time_counter = $TimeCounter
|
||||||
|
|
||||||
|
export (Color) var bonus_color
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
Game.time = 0
|
Game.time = 0
|
||||||
|
|
||||||
|
@ -34,8 +36,18 @@ func _physics_process(delta):
|
||||||
##TOUCH UP LATER
|
##TOUCH UP LATER
|
||||||
#Lives counter
|
#Lives counter
|
||||||
lives_counter.text = str(Game.lives)
|
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
|
||||||
high_counter.text = str("HIGH:") + str("%06d" % Game.high_score)
|
high_counter.text = str("HIGH:") + str("%06d" % Game.high_score)
|
||||||
##Timer
|
##Timer
|
||||||
Game.time += delta
|
Game.time += delta
|
||||||
time_counter.text = Game.timeify(Game.time)
|
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_top = 1.0
|
||||||
margin_bottom = 1.0
|
margin_bottom = 1.0
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
|
bonus_color = Color( 0.478431, 1, 0.47451, 1 )
|
||||||
|
|
||||||
[node name="Back" type="Sprite" parent="HUD"]
|
[node name="Back" type="Sprite" parent="HUD"]
|
||||||
position = Vector2( 128, 95 )
|
position = Vector2( 128, 95 )
|
||||||
|
|
|
@ -719,6 +719,7 @@ texture = ExtResource( 15 )
|
||||||
|
|
||||||
[node name="DustParticles" type="Particles2D" parent="."]
|
[node name="DustParticles" type="Particles2D" parent="."]
|
||||||
position = Vector2( 0, 12 )
|
position = Vector2( 0, 12 )
|
||||||
|
z_index = 1
|
||||||
emitting = false
|
emitting = false
|
||||||
amount = 5
|
amount = 5
|
||||||
lifetime = 0.3
|
lifetime = 0.3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue