@@ -44,21 +44,25 @@ module Phaser {
4444 * Local private reference to game.
4545 */
4646 private _game : Game ;
47+
4748 /**
4849 * Local private reference to its owner sprite.
4950 * @type {Sprite }
5051 */
5152 private _parent : Sprite ;
53+
5254 /**
5355 * Animation frame container.
5456 * @type {number[] }
5557 */
5658 private _frames : number [ ] ;
59+
5760 /**
5861 * Frame data of this animation.(parsed from sprite sheet)
5962 * @type {FrameData }
6063 */
6164 private _frameData : FrameData ;
65+
6266 /**
6367 * Index of current frame.
6468 * @type {number }
@@ -70,6 +74,7 @@ module Phaser {
7074 * @type number
7175 */
7276 private _timeLastFrame : number ;
77+
7378 /**
7479 * Time when this will switch to next frame (in ms).
7580 * @type number
@@ -81,6 +86,7 @@ module Phaser {
8186 * @type {string }
8287 */
8388 public name : string ;
89+
8490 /**
8591 * Currently played frame instance.
8692 * @type {Frame }
@@ -92,16 +98,19 @@ module Phaser {
9298 * @type {boolean }
9399 */
94100 public isFinished : bool ;
101+
95102 /**
96103 * Whethor or not this animation is currently playing.
97104 * @type {boolean }
98105 */
99106 public isPlaying : bool ;
107+
100108 /**
101109 * Whether or not the animation is looped.
102110 * @type {boolean }
103111 */
104112 public looped : bool ;
113+
105114 /**
106115 * Time between frames in ms.
107116 * @type {number }
@@ -113,7 +122,16 @@ module Phaser {
113122 }
114123
115124 public get frame ( ) : number {
116- return this . _frameIndex ;
125+
126+ if ( this . currentFrame !== null )
127+ {
128+ return this . currentFrame . index ;
129+ }
130+ else
131+ {
132+ return this . _frameIndex ;
133+ }
134+
117135 }
118136
119137 public set frame ( value : number ) {
0 commit comments