Example game OmNomNomagon. Weirdness when duplicating layout

Just started using Construct 2? Post your questions here

Post » Thu Nov 27, 2014 6:47 pm

Hi!

I have a question about a nice example game in the arcade: "OmNomNomagon returns" by Stemkoski.
It is found here: http://static1.scirra.net/arcade/games/1217/omnomnomagon-returns.capx
(He has also written a nice tutorial about it)

My question arises if I duplicate the main layout (rightclick on Main Layout->duplicate layout), which also duplicates the code.
I make no changes whatsoever to the layouts or event sheet.

If I run the first (original) layout the game works just fine, but if I run the second layout instead, the ghosts just move to the right, ignoring all collisions.

I´ve looked through the code but I can´t figure out why that happens.
Has someone else here figured that out perhaps?
B
28
S
7
G
4
Posts: 20
Reputation: 3,819

Post » Thu Dec 04, 2014 1:50 pm

you could add Global variables Level =1
then when you complete the level add 1 to global Level 1
so your code looks like
system add 1 to global variable 1
system wait 5 seconds
system restart layout
B
251
S
39
G
15
Posts: 1,964
Reputation: 40,721

Post » Thu Dec 11, 2014 6:21 pm

Thanks, but that doesn´t really seem to help.
If you run layout 2 the ghosts all still just move to the right, and they ignore all collisions. If you run layout 1 they behave as they should.
I can´t understand why this is?
I can´t see what in the code or the variables that make that error happen.

Well, I guess I´ll move on to other examples and tutorials instead.
B
28
S
7
G
4
Posts: 20
Reputation: 3,819

Post » Thu Dec 11, 2014 9:03 pm

Sorry @ moment I have lots of work. Soon as get chance I will see what can I do for you
B
251
S
39
G
15
Posts: 1,964
Reputation: 40,721

Post » Thu Dec 11, 2014 9:41 pm

Make the array global.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,412
Reputation: 59,508

Post » Sat Dec 13, 2014 2:26 pm

Zenox98: Ah, yes, that seems to do the trick! Thank you!
I didn´t know arrays even had that setting, so now I´ve learned something.
B
28
S
7
G
4
Posts: 20
Reputation: 3,819


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests