How do I create procedural walls?

Just started using Construct 2? Post your questions here

Post » Sat Nov 14, 2015 5:00 am

I would like to make a very simple game similar to this:

https://youtu.be/q4Q27tciZ5U

Since it never ends, I assume the cave walls are procedural?
How can you make procedural walls in Construct?
B
29
S
14
G
9
Posts: 80
Reputation: 6,008

Post » Mon Nov 16, 2015 11:42 pm

Can't be done?
B
29
S
14
G
9
Posts: 80
Reputation: 6,008

Post » Tue Nov 17, 2015 4:03 am

Hmm there are tons of ways to do it. Not sure how to explain how to do procedural walls, just add some condition for createObject action though not using createObject would probably be better for performance if you can think of a way to do it like reusing "old" objects.

I would probably just have set of wall pieces moving left that I'd randomly teleport beyond the right edge or something like that.
Or you could have few instances of one wall object that you rotate and move around.
B
21
S
8
G
1
Posts: 43
Reputation: 2,029

Post » Tue Nov 17, 2015 11:01 am

3DPiper you are wrong it can be done. C2 to is capable of anything if you think and code logicly.
B
262
S
49
G
15
Posts: 2,010
Reputation: 42,237

Post » Tue Nov 17, 2015 2:31 pm

Thank you for the replies

Hmm there are tons of ways to do it. Not sure how to explain how to do procedural walls, just add some condition for createObject action though not using createObject would probably be better for performance if you can think of a way to do it like reusing "old" objects.

I would probably just have set of wall pieces moving left that I'd randomly teleport beyond the right edge or something like that.
Or you could have few instances of one wall object that you rotate and move around.


I was thinking of having a rectangle object that I could scale horizontally while skewing vertically. Then for each 'turn' in the cave, add another rectangle to the end with the skew going in the opposite direction. I'm not sure how to line up the ends, though. Plus, the example has the whole cave slowly tapering. However, I don't see those distortions available in C2.

3DPiper you are wrong it can be done. C2 to is capable of anything if you think and code logicly.


I'll be honest, I was hoping for a little more than "yes, it can be done". I posted "How do I create procedural walls" hoping for an answer or hopefully an example. Did I post in the wrong place?
B
29
S
14
G
9
Posts: 80
Reputation: 6,008

Post » Tue Nov 17, 2015 4:17 pm

I tried something with tiles, have a look:

https://drive.google.com/file/d/0B5FlDY ... sp=sharing
B
24
S
3
G
1
Posts: 474
Reputation: 2,211

Post » Tue Nov 17, 2015 5:33 pm

The procedural portion of it is easy. you can think of the whole cave as just a polyline since the top and bottom walls turn at the same x position. So then you just need a bunch of random y values. The visual part of it just needs some way to draw a polygon (canvas or paster plugins can do this).

Here's one possible example:
https://dl.dropboxusercontent.com/u/542 ... hrink.capx
B
95
S
34
G
128
Posts: 5,497
Reputation: 81,682

Post » Tue Nov 17, 2015 7:28 pm

Wow, thank you guys, I will see if I can decipher your examples

:)
B
29
S
14
G
9
Posts: 80
Reputation: 6,008



Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests