Save layout state

  • Is there a way to save the state of a layout as the player moves between them?

    So player character moves a box in layout A, then player transitions to layout B, when he returns to layout A - the box is still moved.

    I know I could do this by recording the position & angle of the objects before the player leaves the layout but I'm working with a LOT of physics objects and they move around wildly so this would be a mammoth task.

    Any ideas?

  • What I'm looking for isn't just save states or maybe it is? I'm confused, I have a game where the player moves between layouts and I want to maintain the history of the layouts within the same play session.

    So player moves stuff around layout a, then moves into layout b and moves more stuff around then goes back to a and everything is as he left it, and when going back to b everything is again how he left it.

    In my mind the save states work for a whole project, if you walk into layout b then back into a, you'll be essentially taking the player back in time to before he even reached b.

    Does that make sense?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would say use a mix of save states (for the actual layout saving) and Webstorage (for the actual variables for the object positions (assuming you don't have many objects you want to move around.) Use Webstorage to save your positions before moving to the next layout and when your players goes back to the other layout, you can use Webstorage to load your positions.

    To be honest, there's no other way. You will have to record data including your physics data.

  • yeah that's the problem and why I posted the thread, I'm using quite a lot of physics objects in a scene, that's going to be real hard to control taking note of their position and angle. I tried it once before and saw many boxes had glitched and went flying across the layout. This is why I'm curious about saving layout state instead of session state, I'd assume it's the same concept but one step removed.

  • Give the objects that shouldn't change the "Persist" behavior... that's all :D

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)