Layout issues

For questions about using Classic.

Post » Sun Apr 03, 2011 7:25 am

I am still relatively new to Construct, so this question may be really stupid.

In my game I am trying to figure out a way to create a separate layout in the game while also keeping the same state in the original layout. I have a "main" layout, where the player controls his space craft in a top down view. On this layout there are planets, where I want the player to be able to land. I am not sure on how to do this.

Originally I created a separate layout on which the player can fly about on the planet. This is fine, as having the same object "Game Controller" on every layout (same object) means I can have private variables stay the same between each layout. But when I set the planet layout to go back to the main layout, obviously the main layout resets to its original state. Is there any way I can freeze the main layout while the second layout is opened?

I experimented with the Layout object, having a layout open in a separate windows or over the top of the main layout, and with this I could pause the main layout as well. But, this causes problems as buttons do not work on the new layout and scrolling does not occur. I don't know if I am doing something wrong or the layout object isn't the way to go

Any help would be greatly appreciated :D
B
8
S
2
G
2
Posts: 144
Reputation: 1,588

Post » Sun Apr 03, 2011 5:10 pm

Hi,

Looks like you are making some cool space games! That is my favorite game type.

I experienced the same problems you had when trying to have the spaceship land on planets, but still return to a non-reset game layout.

I ended up making a separate layout for the space world and the planets and then used global arrays and hash tables to keep track of the state of the game world while moving from one layout to the next.

I show a version of doing this in the Mikey Adventure tutorial in Part 4: Layout Transitions.
viewtopic.php?f=8&t=4421

Hope this helps!
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Tue Apr 05, 2011 8:58 am

Thanks, this looks like exactly what I need! :D
B
8
S
2
G
2
Posts: 144
Reputation: 1,588


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest