Created
April 2, 2011 19:08
-
-
Save julsam/899772 to your computer and use it in GitHub Desktop.
flash punk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @private Updates the animation. */ | |
override public function update():void | |
{ | |
if (_anim && !complete) | |
{ | |
_timer += (FP.fixed ? _anim._frameRate : _anim._frameRate * FP.elapsed) * rate; | |
if (_timer >= 1) | |
{ | |
while (_timer >= 1) | |
{ | |
_timer --; | |
_index ++; | |
if (_index == _anim._frameCount) | |
{ | |
if (_anim._loop) | |
{ | |
_index = 0; | |
if (callback != null) callback(); | |
} | |
else | |
{ | |
_index = _anim._frameCount - 1; | |
complete = true; | |
if (callback != null) callback(); | |
break; | |
} | |
} | |
} | |
if (_anim) _frame = uint(_anim._frames[_index]); | |
updateBuffer(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment