/Hammy/src/animation/Animation.as

https://bitbucket.org/peterm/hammy-as3 · ActionScript · 32 lines · 23 code · 5 blank · 4 comment · 0 complexity · 9aba03fcdd77aecfdfe8871707e4e583 MD5 · raw file

  1. package animation
  2. {
  3. /**
  4. * ...
  5. * @author Peter Mackay
  6. */
  7. public class Animation
  8. {
  9. protected var firstFrame:int;
  10. protected var frameCount:int;
  11. protected var frameDuration:Number;
  12. public function Animation(firstFrame:int, frameCount:int, frameDuration:Number)
  13. {
  14. this.firstFrame = firstFrame;
  15. this.frameCount = frameCount;
  16. this.frameDuration = frameDuration;
  17. }
  18. public function resolve(frame:Number):int
  19. {
  20. return firstFrame + int(frame);
  21. }
  22. public function advance(frame:Number, dt:Number):Number
  23. {
  24. throw new Error("Abstract method.");
  25. }
  26. }
  27. }