Skip to content

Commit

Permalink
Add Clock.tickCount.
Browse files Browse the repository at this point in the history
  • Loading branch information
player-03 committed Sep 1, 2023
1 parent cfa69e9 commit 8b01856
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/echoes/utils/Clock.hx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class Clock {
*/
public var paused:Bool = false;

/**
* How many times this clock ticked since the last call to `addTime()`.
*/
public var tickCount:Int = 0;

/**
* The amount of time left on the `Clock`, in seconds.
*
Expand All @@ -90,6 +95,8 @@ class Clock {
if(this.time > maxTime) {
this.time = maxTime;
}

tickCount = 0;
}
}

Expand All @@ -100,6 +107,7 @@ class Clock {
public function next():Float {
var tick:Float = time > maxTickLength ? maxTickLength : time;
time -= tick;
tickCount++;
return tick;
}

Expand Down

0 comments on commit 8b01856

Please sign in to comment.