Easiest way to make multiple levels?

Get help using Construct 2

Post » Thu Oct 06, 2011 11:34 pm

I have a game in which all the levels will be similar. The first layout is all I have made and has on it all of the objects needed for the game. What is the easiest way to duplicate all of the objects on this layout to another layout, keeping all of the layers correct?

Also this method worries me significantly as after I want to make a change to a universal game object, and I have levels already made, I have to change it in EVERY layout?

Basically, what is the best way to make multiple levels by editing level 1?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Oct 07, 2011 1:16 am

Place all objects in your layout on the same layer. Then click on the home tab. Then click on select all. Then right click on the layout and click copy. Open a new blank layout. Right click anywhere on the layout and select paste. All objects will maintain the same properties as the ones in the original layout.

Another quick way is to simply make every object in the first layout global. Then create an instance variable for each object. Place each object at layer 0. Creat an event sheet that has compare instance variables for each object (i.e, if instance variable = 0 then set object to layer 0, if instance variable >/= 1 set object layer to 1) Then include that event sheet to the event sheet for each level. Make sure each level/layout has at least 2 layers (layer 0 and layer 1, the active layer) Then for each individual level's event sheet have add action as "on start of layout" then an event for each object you want on that level by either adding or subtracting 1 from its instance variable...in essence setting its visibility (layer 1) or hidden behind the scenes (layer 0).

droptank212011-10-10 04:02:14
B
22
S
9
G
3
Posts: 203
Reputation: 3,647

Post » Fri Oct 07, 2011 2:54 am

The first method you stated is probably the way to go - apart from the problem that any updates to any objects will require a major hassle in updating the changes.

The second method sounds inefficient and not really what I'm looking for. It would be incredibly hard to do - especially as I have over 60 objects at the moment.

There must be a simple efficient way to do this. As worst case scenario I would have to update any changed object across all the levels however this is terribly inconvenient. Keep in mind that there will also be non-level layouts for menus.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Oct 07, 2011 4:22 am

I can guarantee that the second method, though it takes time to initally set up, is an extremely efficient method. I have 37 levels and 64 player-usable items set up with it in my game. Practically all of the objects are only on one layout and with this system I can easily create new layouts and with a few events and actions determine which objects are or are not visible on the new layout.

It kind of functions as a CMS for my game.

Here is an early capx showing my example.

Since then I have set everything up so that the inventory, equip subscreen, background tile, etc... are all only present in the 2nd layout, are set as global objects and are included on each layout by setting their instance variables to 1 (moved to layer 1) just like how the inventiry items are.

If I don't want an object visible on a particular layout then I set an action and event to move the object to layer 0 for only that layout. As you can see from the example it truly does function as a quasi-Content Management System for the sprites and objects throughout the whole game. droptank212011-10-07 04:23:30
B
22
S
9
G
3
Posts: 203
Reputation: 3,647

Post » Fri Oct 07, 2011 6:23 am

OK, I am game, however I will need a better explained way to do this in accordance with what I want. Your example does not work for me, I get an error about a behavior which I do not have.

For my game, all objects should be working on all layouts (apart from the menu layouts) however there are minimal changes on each layout. I do not quite understand what you are saying however I am happy to create this instance variable for each object if I know exactly what I am doing.

A problem it seems with your solution is that you can only use one layer in a layout. My layout currently has 3 (a HUD, a main layer, and a background.)sqiddster2011-10-07 06:25:36
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Oct 07, 2011 9:37 pm

Do you have an example capx you can send me?
B
22
S
9
G
3
Posts: 203
Reputation: 3,647

Post » Fri Oct 07, 2011 10:37 pm

Think of the game 'Ghost shooter'. Logistically, mine is very similar (three layers, objects currently not in use outside the layout)
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Oct 08, 2011 12:45 am

I'll whip up a tutorial and put it on here.
B
22
S
9
G
3
Posts: 203
Reputation: 3,647

Post » Sat Oct 08, 2011 1:46 am

Excellent! thanks alot.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Mon Oct 10, 2011 3:58 am

Here is the capx Here
Will be posting the tutorial and examples soon.
B
22
S
9
G
3
Posts: 203
Reputation: 3,647

Next

Return to How do I....?

Who is online

Users browsing this forum: alextro, h1k3, Unconnected and 0 guests