Global Object Problems

This forum is currently in read-only mode.
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • How to keep objects global, but have them not interfere between different layouts?

    I am working on having the player transition to different layouts and back. All objects, besides those physically added to the layout, must be global because otherwise they will diappear when returning back to a layout.

    The problem is the object will then appear in ALL layouts. I don't want that, just want them to appear in their own layout. The only thing I can think of is when exiting a layout make all of such objects invisible and not solid?? Also, I will have to make sure all triggers based on interaction between player and global objects (on other layouts) are turned off. Then when returning, restore their x and y position, make them solid if they were previously, and then make them visible.

    This is starting to get tedious, so I'm wondering for those that have already done this if there is a recommended way!

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I came up with an ok solution for this. I pretty much set all moving object's speeds to zero and then save their location. I then make sure that no events will trigger in the new layout (through collisions etc.. I also set the global sprites to invisible so they don't show. Then with some simple checking if you have been to a layout or not you decide whether to instantiate an object for the first time or just use the saved location. Will send it out in a week or so when I send out the next tutorial. Still interested in an grand ideas though.

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