help with levels

For questions about using Classic.

Post » Mon Dec 21, 2009 4:21 am

It's also possible to set different layouts to use the same event sheet, without needing to use "include event sheet" on each.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Mon Dec 21, 2009 8:51 pm

[quote="AshyRaccoon":1i089jmi]It's also possible to set different layouts to use the same event sheet, without needing to use "include event sheet" on each.[/quote:1i089jmi]

could you tell me how?

Edit: nevermind i saw how to do it now
B
1
G
3
Posts: 5
Reputation: 835

Post » Mon Dec 21, 2009 11:45 pm

[quote="deadeye":2temw6y2]What about the .Count expression? You access it with the "Get number of objects" in the expression editor, or just type ".Count" after your object name.

System: Compare: Enemy.Count = 0

No need for a private variable, unless you want something more complicated.[/quote:2temw6y2]


when i do that then everytime i kill all enemies i come to layout 2 and i cant have more than 2 levels :( what shall i do?
B
1
G
3
Posts: 5
Reputation: 835

Post » Tue Dec 22, 2009 12:35 am

What do you mean you can't have more that two levels? What's happening?

Perhaps it would be easier to help if you posted your .cap file.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Dec 22, 2009 6:27 am

Hmm, well, you could add a global variable, call it something like level. Then use:

System: Compare: Enemy.Count equals 0
- Global: Add 1 to level
- Go to layout global('level')

and make sure the variable level is set properly at the start of the game (its initial value can be changed in the project view).

Hmm.. if you have your layouts named logically, Level 1, Level 2, Level 3, [...] Level 10, Level 11, etc., you could do this instead:
System: Compare: Enemy.Count equals 0
- Global: Add 1 to level
- Go to layout "Level " & global('level')


OR, instead, an alternative, hackish, probably unnecessarily complex way to do it, one I'd recommend against unless all else fails:
You could place an object named LevelInfo on each level, outside the visible play area, or just invisible.. with its own private string variable, NextLevel, and for a value use the name of the next layout, like Level 1's LevelInfo would have the value "Level 2". Then copy your LevelInfo object. Go to layout Level 2, and paste it, then change the variable value to "Level 3", etc.
Then you'd use: Go to layout LevelInfo.value('NextLevel')
There's surely a better way to do it than this last one, though.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests