How do I save the animation frame

Get help using Construct 2

Post » Wed Aug 19, 2015 9:44 pm

Evening folks,

So as i'm working on this project of mine, i'm trying to play around with the animations of a sprite.

My problem seems to be:

Can't get the game to remember the frame, it always turns the frame back to normal.

e.g: I want to change the skin of a character. Pressing a button, allows you to change the skin ( im using drag and drop behaviour)
Whenever the person holds his finger on the character, he's able to drag it around but as soon as he lets go with his finger, the character returns back to starting position.

The person just spend "e.g" 50 coins, buying this skin. it's sad if the person has to buy the skin again, just because he lets go with his finger.

Question is: how do i make the animation STAY at last bought skin ?
B
11
S
3
Posts: 31
Reputation: 814

Post » Thu Aug 20, 2015 7:46 pm

You have stopped the animation ? If you don't if you set the frame it should run the animation from there.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328

Post » Sat Aug 22, 2015 9:14 pm

Image

This is what i got.
Ain't working....

As soon as i let go of the character, the frame is set back to " 0 " and the player has to buy the skin again.
B
11
S
3
Posts: 31
Reputation: 814

Post » Sat Aug 22, 2015 9:23 pm

Never mind.

I manage to solve it by making a Global Variable, controlling what frame to use.
B
11
S
3
Posts: 31
Reputation: 814

Post » Sun Aug 23, 2015 5:30 am

It does work - I use something similar in my Jam game - I think there's a fault in your code. Setting the animation itself I think undoes this.

I would also make it an instance variable of Character, as it's a property of it.
My tutorial through development blog is at http://myconstruct2dev.blogspot.co.uk/
B
12
S
3
Posts: 221
Reputation: 1,328


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, NN81, plinkie, TsubaRu and 9 guests