How do I randomly create and remove tiles?

Get help using Construct 2

Post » Fri Mar 20, 2015 7:12 am

Hey guys! Have had alot of help here before and am struggling with an idea.

To put it simply; can I create a small 32x32 solid tilemap and add/remove random blocks? I've got a jumping based platformer and want to add a little block every now and then that creates a random shape.

I've read alot about autotiling / arrays and am happy to go deep into these if needed, but thought I'd ask here first to check if I'm missing something relatively simple to add or remove random blocks in a tilemap.
B
6
S
2
Posts: 22
Reputation: 540

Post » Fri Mar 20, 2015 7:46 am

You can just use the random function and floor it, but if you want to make random shapes, that would be more difficult. Adding random tiles to random locations is easy though.
For example:
tilemap > set tile at
X: [int(random(tilemap.width)/{put tile dimensions here})] to {whatever tile}
Y: same as above but using tilemap.height

To remove tiles you just do the same thing, but with the 'erase' action.

To make certain shapes you would have to make a whole bunch of rules for where tiles can go, and then use repeat loops or something similar to check each tile in an area for those rules, or something like that.
...Or ask someone who knows more than I do about random generation.
'Good' gameplay is gameplay that gets the effect you want.
Want to make a game with me? Come here!
My example capxs
My Game Art 'Portfolio'
B
30
S
9
G
1
Posts: 134
Reputation: 3,159

Post » Fri Mar 20, 2015 12:23 pm

Thanks alot man, appreciate it. This will give me a good starting point !
B
6
S
2
Posts: 22
Reputation: 540


Return to How do I....?

Who is online

Users browsing this forum: Husui, josevasquez, zenox98 and 23 guests