How do I make levels

Get help using Construct 2

Post » Thu Apr 09, 2015 11:27 am

How do i make more than 10 levels just in one or two layout
B
50
S
16
G
10
Posts: 202
Reputation: 8,234

Post » Thu Apr 09, 2015 11:33 am

The most obvious way that springs to mind would be to store your levels in a separate file - .txt, .xml, .json etc - and parse the values, maybe into an array, and create the level based on the array.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
126
S
29
G
73
Posts: 5,089
Reputation: 51,998

Post » Thu Apr 09, 2015 11:38 am

What is steps to do that
B
50
S
16
G
10
Posts: 202
Reputation: 8,234

Post » Thu Apr 09, 2015 1:18 pm

Make new layouts called Level 1, Level 2 etc but make sure to select "Don't Create Event Sheet". Next Right click on event sheet to create on call it "Level Event Sheet" This is where you will store your main game code. Now go on to each of your level layouts and in the properties panel under Event Sheet select Level Event Sheet. Next create the actual look of your levels and code in the correct places. Next create a global variable called "OnLevel" and create an object in your level layouts call it "EndBlock" Create an instance variable attached to it and call it Level (initial value will be the level it's on). Next go in to your event sheet and use the following event: Player on collision with end block - go to layout (by name) ""Level " & EndBlock.Level + 1" Ok now make a sub event for that event: If EndBlock.Level = OnLevel - Then add 1 to OnLevel. Next create a new layout with event sheet. this will be the level selector. Make it look how you want with the same amount of numbers as levels (Make all the numbers the same object just use seperate animations and program them to play at correct times and create instance var called Level). And in the event sheet (for level selector) say: On touch LevelSelectNumber and LevelSelectNumber.Level is = or < OnLevel - go to layout (by name) ""Level " & LevelSelectNumber.Level" That is how I make Levels.
B
3
Posts: 9
Reputation: 193

Post » Thu Apr 09, 2015 1:22 pm

You could, provided you have the pro version, store the levels as a layer each and just set them to visible/invisible while also grouping the events for each level and activating/deactivating them.

So when you hit level two you hide the level 1 layer, show the level 2 layer and than on the event sheet you disable the level 1 group and than enable the level 2 group.

Although it may get a bit messy. Zenox and Vedal have a much more efficient solution.
The Aurora Borealis? At this time of year? At this time of day? In this part of the country? Localized entirely within your kitchen?
B
11
S
2
Posts: 16
Reputation: 638

Post » Thu Apr 09, 2015 1:50 pm

Not trying to confuse you even more, but what might come in handy are groups.

Groups can be activated and deactivated.
If you use a group for level-specific events (for example positioning of the sprites) you can have the game specifics always active and just toggle the groups on and off depending on the level.
Starting the group with a trigger once event would in this case allmost work like an on start of layout (Ofcourse in this case better called "on start of level")
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 » Thu Apr 09, 2015 2:36 pm

what to do ?
B
50
S
16
G
10
Posts: 202
Reputation: 8,234

Post » Thu Apr 09, 2015 2:48 pm

Do you already have a level completed?
Maybe even two?
Your question isn't very clear and not knowing how much experience you have in working with Construct2, it's not easy to give an answer that is sure to help you..
If you could provide a capx or explain better what it is exactly you don't know how to do, I think the answers would help you more..
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 » Thu Apr 09, 2015 3:01 pm

I have made simple game already so i wanna know how to make more than level as a whole (generally)
B
50
S
16
G
10
Posts: 202
Reputation: 8,234

Post » Thu Apr 09, 2015 3:14 pm

If you would like to create a second level in the same way you did the first, the easiest option would be creating a new layout for it.
If you really want to do it on the same layout, the best way would be to place/create all your objects/assets in your "on start of layout" or through a function.
The coordinates and all other relevant information could be stored in an array (internal or external through Ajax)
Using groups as I mentioned above would make it easy to have this placement different per level.
Activating group level1 to create the objects where they should be in level1, Activating group level2 to create the objects where they should be in level2.
It's impossible for me to be more specific without knowing anything about your game.
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

Next

Return to How do I....?

Who is online

Users browsing this forum: justintime0185, oddreal, oosyrag, TRMG, twomonocles and 11 guests