How do I - Scene Based Levels ?

Get help using Construct 2

Post » Fri May 20, 2016 6:55 pm

Damn i was creating something for you, had already spent a good amount of time and things were progressing nicely... than c2 crashed and I didnt save the work... not even a single backup :(
B
22
S
4
G
3
Posts: 61
Reputation: 2,683

Post » Fri May 20, 2016 8:22 pm

procedural Dungeon Generator this might help i guess. not sure how well you will understand it.
B
70
S
20
G
67
Posts: 1,314
Reputation: 42,301

Post » Fri May 20, 2016 9:22 pm

Okay, I "finished" what I was creating for you. It's very glitchy right now because it needs a lot of improvements. But the main idea allows you to do what you want.

You can download it here:
https://dl.dropboxusercontent.com/u/231 ... cenes.capx

Let me explain what I did:
On the layout you can see a some scenes. They are designed scene 1, 2, 3 and so on based on horizontal displacement. The code recognizes the scene based on the position, so that's why I created some sort of grid with the pink bars.

On start of layout, scene 1 will be picked and a random scene (excluding scene 1) will be picked for next scene. All objects positions and angle are stored in local variables.
When a scene is picked, all elements inside the area designed to that scene will be picked. Made that using families for immovable and movable objets.
All objects overlapping the picked coloured background (bg) are pinned to it and than the coloured background is moved to 0,-bg.height (except for the first scene {scene 1} which goes to 0,0).
After that, objects are unpinned and they start moving down with custom movement.
When the coloured background collides with a detector at 0,2*bg.height, bg is moved to it's previous position (stored in local variable at start of layout) and all objects that were overlapping it are also resetted to their initial positions, than pinned to bg again. (This part is glitchy, needs improvements)
Also, when detector is collided, a new scene is picked and created on top of current scene.

Hope that wasn't much confusing and also hope that suits what you need.
B
22
S
4
G
3
Posts: 61
Reputation: 2,683

Post » Fri May 20, 2016 10:04 pm

Tuiii wrote:Okay, I "finished" what I was creating for you. It's very glitchy right now because it needs a lot of improvements. But the main idea allows you to do what you want.

You can download it here:
https://dl.dropboxusercontent.com/u/231 ... cenes.capx

Let me explain what I did:
On the layout you can see a some scenes. They are designed scene 1, 2, 3 and so on based on horizontal displacement. The code recognizes the scene based on the position, so that's why I created some sort of grid with the pink bars.

On start of layout, scene 1 will be picked and a random scene (excluding scene 1) will be picked for next scene. All objects positions and angle are stored in local variables.
When a scene is picked, all elements inside the area designed to that scene will be picked. Made that using families for immovable and movable objets.
All objects overlapping the picked coloured background (bg) are pinned to it and than the coloured background is moved to 0,-bg.height (except for the first scene {scene 1} which goes to 0,0).
After that, objects are unpinned and they start moving down with custom movement.
When the coloured background collides with a detector at 0,2*bg.height, bg is moved to it's previous position (stored in local variable at start of layout) and all objects that were overlapping it are also resetted to their initial positions, than pinned to bg again. (This part is glitchy, needs improvements)
Also, when detector is collided, a new scene is picked and created on top of current scene.

Hope that wasn't much confusing and also hope that suits what you need.


Thank you so much! :P You rock!
This think really helped me. I understand your idea. Yes, it needs a lot of improvements. Some levels overlapped, needs optimize windows size (camera) vs. I love Construct 2, really amazing! Thank you, I am working on improvements.
I want to learn Construct 2. I have 4 amazing book for Construct 2 learning. Let's see what can I do?
B
12
S
6
Posts: 33
Reputation: 1,056

Post » Sun Feb 26, 2017 6:33 pm

Could something like this be done using layers and moving those layers independently. Kind of like how parallax works?

1. You create each level/scene/part on a separate layer.

2. Then you activate and move the next layer into place in code.

Forgive my ignorance into how layers work in Construct 2 but I have done it this way in another framework.
B
8
S
2
Posts: 2
Reputation: 514

Post » Thu Apr 06, 2017 7:23 am

Message: Marrewijk can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Quasar wrote:
Tuiii wrote:Okay, I "finished" what I was creating for you. It's very glitchy right now because it needs a lot of improvements. But the main idea allows you to do what you want.

You can download it here:
https://dl.dropboxusercontent.com/u/231 ... cenes.capx

Let me explain what I did:
On the layout you can see a some scenes. They are designed scene 1, 2, 3 and so on based on horizontal displacement. The code recognizes the scene based on the position, so that's why I created some sort of grid with the pink bars.

On start of layout, scene 1 will be picked and a random scene (excluding scene 1) will be picked for next scene. All objects positions and angle are stored in local variables.
When a scene is picked, all elements inside the area designed to that scene will be picked. Made that using families for immovable and movable objets.
All objects overlapping the picked coloured background (bg) are pinned to it and than the coloured background is moved to 0,-bg.height (except for the first scene {scene 1} which goes to 0,0).
After that, objects are unpinned and they start moving down with custom movement.
When the coloured background collides with a detector at 0,2*bg.height, bg is moved to it's previous position (stored in local variable at start of layout) and all objects that were overlapping it are also resetted to their initial positions, than pinned to bg again. (This part is glitchy, needs improvements)
Also, when detector is collided, a new scene is picked and created on top of current scene.

Hope that wasn't much confusing and also hope that suits what you need.


Thank you so much! :P You rock!
This think really helped me. I understand your idea. Yes, it needs a lot of improvements. Some levels overlapped, needs optimize windows size (camera) vs. I love Construct 2, really amazing! Thank you, I am working on improvements.
I want to learn Construct 2. I have 4 amazing book for Construct 2 learning. Let's see what can I do?




This exactly what i also want to do in my games (build a buildbox-like game, but with the added flexibility of the event system of construct 2/3. Could you please repost the scenes.capx example you made, so that i can learn from it on how to implement it? (it is not accesceble anymore on dropbox due to their changes).

Any one other suggestions on how to do this? Maybe the original poster?

Thx in advance!
B
4
Posts: 1
Reputation: 202

Post » Wed Apr 26, 2017 3:34 am

Marrewijk wrote:
Quasar wrote:
Tuiii wrote:Okay, I "finished" what I was creating for you. It's very glitchy right now because it needs a lot of improvements. But the main idea allows you to do what you want.

You can download it here:
https://dl.dropboxusercontent.com/u/231 ... cenes.capx

Let me explain what I did:
On the layout you can see a some scenes. They are designed scene 1, 2, 3 and so on based on horizontal displacement. The code recognizes the scene based on the position, so that's why I created some sort of grid with the pink bars.

On start of layout, scene 1 will be picked and a random scene (excluding scene 1) will be picked for next scene. All objects positions and angle are stored in local variables.
When a scene is picked, all elements inside the area designed to that scene will be picked. Made that using families for immovable and movable objets.
All objects overlapping the picked coloured background (bg) are pinned to it and than the coloured background is moved to 0,-bg.height (except for the first scene {scene 1} which goes to 0,0).
After that, objects are unpinned and they start moving down with custom movement.
When the coloured background collides with a detector at 0,2*bg.height, bg is moved to it's previous position (stored in local variable at start of layout) and all objects that were overlapping it are also resetted to their initial positions, than pinned to bg again. (This part is glitchy, needs improvements)
Also, when detector is collided, a new scene is picked and created on top of current scene.

Hope that wasn't much confusing and also hope that suits what you need.


Thank you so much! :P You rock!
This think really helped me. I understand your idea. Yes, it needs a lot of improvements. Some levels overlapped, needs optimize windows size (camera) vs. I love Construct 2, really amazing! Thank you, I am working on improvements.
I want to learn Construct 2. I have 4 amazing book for Construct 2 learning. Let's see what can I do?




This exactly what i also want to do in my games (build a buildbox-like game, but with the added flexibility of the event system of construct 2/3. Could you please repost the scenes.capx example you made, so that i can learn from it on how to implement it? (it is not accesceble anymore on dropbox due to their changes).

Any one other suggestions on how to do this? Maybe the original poster?

Thx in advance!


Here you are, sir

https://ufile.io/ibiwy
B
22
S
4
G
3
Posts: 61
Reputation: 2,683

Previous

Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 8 guests