How do I make 2world go to right levels?Stuck..again...

Get help using Construct 2

Post » Wed Mar 26, 2014 2:26 pm

Hi guys,

I'm trying to make a level select with webstorage. So i used the capx ramones send in this forum:
viewtopic.php?t=71811&start=0

the problem is that i have no idea how to make it go to the right levels in the second world. World one was easy, i just added level instance for each level (15 on world 1 in my game) as a second condition. So it would look like this. Array is 15 width 2 height and 1 depth

touching: sprite ------------------------------------------------------------------------go to level 1
array: value at(Sprite.level,currentworld) not locked
sprite: level=1

touching ---------------------------------------------------------------------------------go to level 2
array: value at(Sprite.level,currentworld) not locked
sprite: level=2
etc......

But when i reach the next world (level16) it will play level 1, level 16 will play level 2. How can i fix this? Tried several conditions but didn't find a solution.

Thanks for taking the time to help me!!!!!
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Wed Mar 26, 2014 3:03 pm

Would adding a global variable World help?
Set it to 1 on world 1, to 2 on world 2, etcetera..
And add the variable check into your code..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Mar 26, 2014 5:58 pm

thanks for the reply, but no. I already tried that, no effect.....
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Thu Mar 27, 2014 5:38 am

LittleStain wrote:Would adding a global variable World help?
Set it to 1 on world 1, to 2 on world 2, etcetera..
And add the variable check into your code..


Nop already tried that.....
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Thu Mar 27, 2014 10:50 am

Solved: Only with world 2 I added the compare variable world =2. However it also should be in world 1. Because otherwise it will always play world1 levels because it comes first in the level sheet, so I added in world 1 compare variable world =1. Little bit dumb of me.... however thanks for the reply!
B
7
S
2
G
1
Posts: 77
Reputation: 727


Return to How do I....?

Who is online

Users browsing this forum: jatoblendy and 48 guests