Switching Between Layouts

Get help using Construct 2

Post » Tue May 22, 2012 12:20 am

Do all the variables get reset if you switch between layouts?

B
22
S
5
G
3
Posts: 194
Reputation: 5,855

Post » Tue May 22, 2012 3:05 am

Global variables don't
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644

Post » Tue May 22, 2012 5:46 am

If objects are set as global objects, then no--these variables carry across layouts. But if they're not set to global objects, then technically they're a completely new object when they're in another layout.
B
14
S
1
G
2
Posts: 85
Reputation: 2,810

Post » Tue May 22, 2012 3:18 pm

The reason i ask is because at one point i tried to create a level select screen that had unlocks on it. When the player completed a level a new level would be unlocked. I kinda cheated it a bit.

I would have 2 sets of objects. A level number sprite and a level unlock sprite. I set it to where if the player completed a level a global variable would be set to for instance 2 for level 2 complete.

then on the level select screen i would have If global variable = 2 set level number sprite to position level unlock sprite. If they collided then the unlock would be destroyed.

I don't think my way of doing things are optimal by any means lol.
B
22
S
5
G
3
Posts: 194
Reputation: 5,855


Return to How do I....?

Who is online

Users browsing this forum: makkancs and 25 guests