Skip to content

Commit

Permalink
Adjust for conflict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkStoorM committed Aug 24, 2024
1 parent 18c24a4 commit 6a0a681
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions JumpRoyale/src/TimerOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ public partial class TimerOverlay : VFlowContainer

private const float ColorAlpha = 0.75f;

private static readonly int GameLength = GameOverlay.GameLength;

private int _timerSeconds = GameLength;

private Color _defaultColor = new(1, 1, 1, ColorAlpha);
private Color _flashColor = new(1, 0, 0, ColorAlpha);

Expand All @@ -27,6 +23,8 @@ public partial class TimerOverlay : VFlowContainer
[Signal]
public delegate void TimerDoneEventHandler();

public int TimerSeconds { get; private set; } = GameOverlay.GameLength;

public override void _Ready()
{
_timerLabel = GetNode<Label>(TimerNodeName);
Expand All @@ -46,7 +44,7 @@ public async Task StartTimer()

UpdateTimer();

if (_timerSeconds <= 0)
if (TimerSeconds <= 0)
{
EmitSignal(SignalName.TimerDone);

Expand All @@ -58,14 +56,14 @@ public async Task StartTimer()

private void UpdateTimer()
{
_timerSeconds--;
TimerSeconds--;

int seconds = _timerSeconds % 60;
int minutes = _timerSeconds / 60;
int seconds = TimerSeconds % 60;
int minutes = TimerSeconds / 60;

_timerLabel.Text = $"{minutes}:{seconds:00}";

if (_timerSeconds > FinalCountdown)
if (TimerSeconds > FinalCountdown)
{
_sprite.Modulate = _defaultColor;

Expand Down

0 comments on commit 6a0a681

Please sign in to comment.