Skip to content

Commit

Permalink
added a progress getter to the timer class
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamAtomic committed May 20, 2011
1 parent 69eb96e commit f4cdc42
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions org/flixel/FlxTimer.as
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ package org.flixel
return loops-_loopsCounter;
}

/**
* Read-only: how far along the timer is, on a scale of 0.0 to 1.0.
*/
public function get progress():Number
{
if(time > 0)
return _timeCounter/time;
else
return 0;
}

static public function get manager():TimerManager
{
return FlxG.getPlugin(TimerManager) as TimerManager;
Expand Down

0 comments on commit f4cdc42

Please sign in to comment.