Adding an Additional frame to "PlayerAnimations.MOVE"

Skip to first unread message

Joe Ford

Apr 20, 2014, 8:40:23 PM4/20/14
Right now the Andou's Move animation is dictated by this piece of code from the GameObjectFactory class (among others):

            SpriteAnimation angle = new SpriteAnimation(PlayerAnimations.MOVE.ordinal(), 1);
            angle.addFrame(new AnimationFrame(
                    Utils.framesToTime(24, 3), pressAndCollectVolume, basicVulnerabilityVolume));

I'd like to add a second Move frame by adding something like this:

            angle.addFrame(new AnimationFrame(
                    Utils.framesToTime(24, 3), pressAndCollectVolume, basicVulnerabilityVolume));

(and then obviously updating ".ordinal(), 1);" to ".ordinal(), 2);")

But the code above simply skips the first frame, goes directly to the second frame, and STAYS on the second frame for as long as I'm continuing to move.

On the other hand, when i implemented something similar for the Idle animation frames (for example, now Andou's Idle animation could include two images to give the effect like he's blinking etc), it worked fine. 

Can someone tell me how I can add a second frame to the Move animation? I suspect there's something dictating how long this set of frames lasts, and I can't seem to find out what.


Joe Ford

Apr 20, 2014, 8:54:46 PM4/20/14
Looks like I didn't play around enough before posting. I have part of the problem solved. Changing the two Utils.framesToTime(24, 3) lines to to 0.5f shows me BOTH frames. Now my only issue is they're not repeating.  

Joe Ford

Apr 20, 2014, 8:58:20 PM4/20/14
And now i noticed I wrote "idle.setLoop(true);" instead "angle.setLoop(true);"  ~face palm~

Soooooo it's working as it should. I apologize if anyone wasted their time reading thing.   Maybe someone not familiar with changing the animations will find it helpful.

Bart Hirst

Apr 21, 2014, 11:55:06 AM4/21/14
to ReplicaIsland Coding Community
No problem at all Joe, thanks for posting

You received this message because you are subscribed to the Google Groups "ReplicaIsland Coding Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Reply all
Reply to author
0 new messages