Help With Sequential Animations

Get help using Construct 2

Post » Fri Mar 22, 2013 3:50 am

Hey everyone.

I have managed to figure out how to get an animation to play forward (when someone clicks on an empty sprite box on the right side of the screen) and then in reverse (When the player clicks on an alternate empty sprite box on the left). Basically, I created two separate animations within the Sprite object...I named the 1st one "forward" and then I created another animation and reversed the order of the frames so when it's run it runs the sequence in reverse which I creatively titled "reverse".

On my event sheet I have an "on start of layout" event that stops the animation at the initial frame.

Then I have an "on touched" event associated with the right hand empty sprite box that sets the animation to "forward" (Play from beginning) and another "On Touched" event (tied to the left hand empty sprite)that effectively plays the reverse version of the sprite object when clicked/touched.

Now here is my problem: I have multiple Sprites (with a "Forward" and "Reverse" animation) for this layout and desperately need to figure out a way to have the the Sprites swap out in a sequential manner depending on which sprite was just played and which animation played.

For example - The animation is for sprite A is halted on frame 1. The user clicks the right hand empty sprite object which fires off the "forward" sprite animation (of Sprite A) which after running at the designated FPS halts on the last frame. This last frame of the "Forward" animation of Sprite A is the also the first frame of the "Forward" animation associated with Sprite B so the transition is seamless but I need Sprite A to be hidden on the end of the "on clicked" and Sprite B made visible (and in a stopped state) on its initial frame. THEN when the user clicks the right hand empty sprite box again the "forward" animation of Sprite B plays and ends in an identical fashion to Sprite A which transitions seamlessly into sprite C's Forward animation when the right hand empty sprite box is clicked a 3rd time....and so on and so forth.

Inversely, I also need the Left hand empty sprite boxes to manage the sequential playback of the "reverse" animations of each sprite depending upon which sprite is currently visible.

I hope this makes sense and a GREATLY appreciate any help you guys can provide.

R/s
Elemental Entertainment LLC

B
11
S
2
Posts: 65
Reputation: 1,396

Post » Fri Mar 22, 2013 6:17 am

why do you need to swap the sprites? you can have all the animations in only one sprite.

i think you need to destroy the sprite a in the last frame and then spawn sprite b in the last position of sprite a.haifisch2013-03-22 06:18:50
B
17
S
2
G
2
Posts: 82
Reputation: 1,712

Post » Fri Mar 22, 2013 6:44 am

I suppose I could do it as one large animation but doing it this way lets me have forward and backward for each segment which is vital for this project. If you know a way to code it using one large sprite where I some how designate a frame range per on-touch (either forward or backward) I would be happy to try it. ;)
B
11
S
2
Posts: 65
Reputation: 1,396

Post » Thu Aug 29, 2013 11:50 pm

@E2GameStudios:

Could you possibly explain how you were able to reverse your sprite animation. If you can help this would really help me with memory and size issues. Not to mention not having to create both a forward and reverse sprite sheet.

Any help is deeply appreciated. Thanks.
B
3
Posts: 18
Reputation: 236


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests