Sprite starts on Layout 1 at x0,y0. Player moves it to x100,y100. This movement triggers layout 2 (the sprite is not used in layout 2). When clicking a button on Layout 2 to return to Layout 1, the sprite shows up back init's original position of 0,0 rather than at its last moved to position of 100,100. How do I return to Layout 1 with the sprite showing at the last moved to position of 100,100?
Develop games in your browser. Powerful, performant & highly capable.
See if this helps. https://www.dropbox.com/s/dkqrwnwdz75qh ... .capx?dl=0
Basically use a global variable to keep track of where you came from, and have multiple spawn locations based on that variable.
Got it oosyrag. Thank you!
If you're going for something like an inventory screen, where you can leave from anywhere on the map, you can just add the "persist" behavior to all the objects in your first layout that move or can be destroyed during the game. The only new thing is that you have to add the "reset persisted objects" action if you want the level to actually reset later on.