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: 5,998

Post » Mon Nov 16, 2015 11:42 pm

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

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
17
S
6
G
1
Posts: 41
Reputation: 1,725

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
255
S
39
G
15
Posts: 1,982
Reputation: 41,005

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: 5,998

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: 454
Reputation: 2,171

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
94
S
33
G
114
Posts: 5,357
Reputation: 73,775

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: 5,998



Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests