added different timer and life colors for if you have the bonus

This commit is contained in:
pennyrigate 2023-01-18 16:21:59 -05:00
parent f4dda0ab1b
commit ade77af031
3 changed files with 14 additions and 0 deletions

View file

@ -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

View file

@ -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 )

View file

@ -719,6 +719,7 @@ texture = ExtResource( 15 )
[node name="DustParticles" type="Particles2D" parent="."]
position = Vector2( 0, 12 )
z_index = 1
emitting = false
amount = 5
lifetime = 0.3