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 ?
Develop games in your browser. Powerful, performant & highly capable.
You have stopped the animation ? If you don't if you set the frame it should run the animation from there.
This is what i got.
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.
I manage to solve it by making a Global Variable, controlling what frame to use.
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.