Best way to handle multiple levels

For questions about using Classic.

Post » Fri Oct 15, 2010 3:08 am

What is the best way to think about multiple levels in construct? Should each level be in a different layout or should events be used to load things to get another level?

How are behaviors of objects updated if there are multiple levels? Must changes be done individually on every level?

Can an object have a static variable? IE: player sprite has a static health variable that does not change from layout to layout.
B
2
G
2
Posts: 24
Reputation: 698

Post » Fri Oct 15, 2010 10:15 am

[quote="aCuria":2b5j4p1n]What is the best way to think about multiple levels in construct? Should each level be in a different layout or should events be used to load things to get another level?[/quote:2b5j4p1n]

Generally speaking the 2nd method you mention would be preferable. However, if you have a little game with say 3 levels it might be more of a hassle and not really worth the effort to develop such a system/level editor.

[quote="aCuria":2b5j4p1n]How are behaviors of objects updated if there are multiple levels? Must changes be done individually on every level? [/quote:2b5j4p1n]

This question somewhat confuses me. If you have instances of an object with a certain behavior on multiple layouts, it will naturally work on all of them.

[quote="aCuria":2b5j4p1n]Can an object have a static variable? IE: player sprite has a static health variable that does not change from layout to layout.[/quote:2b5j4p1n]

That's what global variables are meant for. So instead of using a private variable which is directly connected to the object, you use a global variable, which will stay the same throughout layouts. Also look into global objects. But beware this will mean that the object keeps existing on every layout unless you destroy it.

And welcome to the forums. :)
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests

cron