Create obstacles procedurally

Get help using Construct 2

Post » Sat Nov 03, 2012 12:04 am

I'm trying to make an infinite runner like Canabalt.
I know how to make a paralax effect for the background, but have no idea about how to create the random obstacles and ground.

What would be the best way to do it?

I have a little idea, maybe the player doesn't move and it only jumps, but the platform and obstacles create the sense of movement and I'll have to do some calculations to create holes that the player can jump, but I dont know how.
B
34
S
4
G
5
Posts: 84
Reputation: 4,835

Post » Sat Nov 03, 2012 9:03 pm

First create several different types of platforms you want the player to land on while running.

next, using the system (every 1 second or something) to spawn new objects.

Set their X position to just beyond the .x of the layout of the screen so that they will start off screen.

Next use a system every tick event to move the platforms back in -X towards the player at whatever interval you want (probably a variable that will increase over time to speed up the buildings.

Then lock the player's jump so that its only up and down and they can't move left and right.

to separate the platforms so that they get created at a variable distance, set that original random timer you used to spawn the platforms to a setting like random(5) seconds. This way, some will be further apart and some will be closer together. Make sure the maximum distance apart isn't too big for the player to jump though. Also you will probably need to add another variable to that as the speed increases because the gap the player crosses will get bigger and bigger as the speed of the platforms come towards them.
B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Sat Nov 10, 2012 5:07 pm

Wow that's fantastic! :D
I just bought the standard version of Construct 2 to be able to publish to IOS/Android and use families.

But using dt i've found a new problem:
https://dl.dropbox.com/u/76175551/Problem.capx

The objects appear at minimal diferent distances and I can't use Wrap behaviour because it interferes with other things i'm planning to do.
What do you recommend to avoid those gaps
B
34
S
4
G
5
Posts: 84
Reputation: 4,835


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, DemantDigitalArt, Magistross and 27 guests