I have a character (sprite) which is my player. When player walks into some "doors" he should be transported to the next layout (level) and be able to back to previous one layout (level).
Sounds trivial, but... this character (sprite) has several instance values like healthPoints etc. No matter what I try I can't get the instance variables to persist.
What I have tried:
1. Add persist behaviour to the object - It doesn't work, but that's understandable cause Persist behaviour remembers the state of the object instance for the particular layout.
2. Set "playersLayer" to global and player object to global - in result object is automatically (no need to add it manually) created on the layout with the initial state of the instance variables. Well I thought "global" moves the instance to the next layout so I would expect to keep the instance variables unchanged... but not
3. Allright so I've tried to set layer and character object to global AND add a persist behaviour hoping maybe this will keep the instanca variables set up... but again failure.
I think I am missing something right? Do I really need to save those values somewhere in a dictionary or so and then load it after layout switch or there is a smart way to move The Player in one piece all over the layouts?