Global Object Problems

For questions about using Classic.

Post » Sat Aug 29, 2009 3:49 pm

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
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Aug 29, 2009 6:07 pm

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.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests