Added a label for the effect timer

It looks a bit weird but I couldn't be bothered to fix it
This commit is contained in:
Puppet committed 2025-10-08 23:06:56 -07:00
1 parent ace7c8fb03
commit 213dd83e24
2 files changed
+32 -4

No files matched your search

+21 -4
View File
@@ -51,8 +51,8 @@ layout_mode = 1
anchors_preset = 5 anchors_preset = 5
anchor_left = 0.5 anchor_left = 0.5
anchor_right = 0.5 anchor_right = 0.5
offset_left = -228.0 offset_left = -536.0
offset_right = 720.0 offset_right = 1697.3333
offset_bottom = 308.0 offset_bottom = 308.0
grow_horizontal = 2 grow_horizontal = 2
scale = Vector2(0.48, 0.48) scale = Vector2(0.48, 0.48)
@@ -67,9 +67,9 @@ layout_mode = 1
anchors_preset = 5 anchors_preset = 5
anchor_left = 0.5 anchor_left = 0.5
anchor_right = 0.5 anchor_right = 0.5
offset_left = -257.0 offset_left = -536.0
offset_top = 148.0 offset_top = 148.0
offset_right = 812.0 offset_right = 1697.3333
offset_bottom = 361.0 offset_bottom = 361.0
grow_horizontal = 2 grow_horizontal = 2
scale = Vector2(0.48, 0.48) scale = Vector2(0.48, 0.48)
@@ -78,3 +78,20 @@ theme_override_font_sizes/font_size = 156
text = "High Score: 0" text = "High Score: 0"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
[node name="EffectTimerLabel" type="Label" parent="CanvasLayer/ScoreText"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -536.0
offset_top = 250.00002
offset_right = 1697.3333
offset_bottom = 463.0
grow_horizontal = 2
scale = Vector2(0.48, 0.48)
theme_override_fonts/font = ExtResource("4_kldst")
theme_override_font_sizes/font_size = 156
text = "{Effect} expires in: {Time}"
horizontal_alignment = 1
vertical_alignment = 1
+11
View File
@@ -5,8 +5,19 @@ public partial class ScoreText : Control {
public override void _Process(double delta) { public override void _Process(double delta) {
Label ScoreText = GetNode<Label>("ScoreLabel"); Label ScoreText = GetNode<Label>("ScoreLabel");
Label HighScoreText = GetNode<Label>("HighScoreLabel"); Label HighScoreText = GetNode<Label>("HighScoreLabel");
Label EffectTimerText = GetNode<Label>("EffectTimerLabel");
ScoreText.Text = "Score: " + Globals.Score; ScoreText.Text = "Score: " + Globals.Score;
HighScoreText.Text = "High Score: " + Globals.HighScore; HighScoreText.Text = "High Score: " + Globals.HighScore;
if (Globals.ActiveEffect == "none") {
EffectTimerText.Text = "";
} else {
string EffectTimerType = "";
if (Globals.ActiveEffect == "ultra") {
EffectTimerType = "Boost";
}
EffectTimerText.Text = EffectTimerType + " " + "expires in: " + Math.Floor(Globals.EffectTimer * 10) / 10 + "s";
}
} }
} }