How do I delete tiles (Conditional)

Get help using Construct 2

Post » Wed Apr 22, 2015 3:33 am

I was wondering how to delete or change tiles from the tile map based on the blocks around them. For example, if a grass tile is surrounded on both sides by erased tiles, erase it. I want to achieve this because I am currently working on a game with random terrain generation, and there will occasionally be a single block sticking up in the terrain, which makes the player have to jump constantly. Thank you for the feedback. If you need additional info, or a .capx, feel free to comment or message me
B
8
S
2
Posts: 39
Reputation: 604

Post » Wed Apr 22, 2015 3:51 am

Determine this object that you wanna delete it from projects
B
55
S
18
G
10
Posts: 209
Reputation: 8,546

Post » Wed Apr 22, 2015 3:57 am

I'm sorry, but I don't really know what you mean. What would I do in terms of Code?
B
8
S
2
Posts: 39
Reputation: 604

Post » Wed Apr 22, 2015 4:10 am

do you want delete an object ?
B
55
S
18
G
10
Posts: 209
Reputation: 8,546

Post » Wed Apr 22, 2015 7:42 am

I replied to your other thread with a brief explanation. Here's a new capx (same filename as before though) which does what you want.. I added a comment so you know where I added to it..

erase lonely tile

I didn't have time before but I added storing the GenY into an array to get the exact Y position of each block to check. Seems to work ;)
B
15
S
5
G
7
Posts: 876
Reputation: 5,650

Post » Thu Apr 23, 2015 12:30 am

Thank you again for your help @procrastinator. This helped me a bunch. I really appreciate all you've done. Ever since I joined every one has been so nice. Thanks :)
B
8
S
2
Posts: 39
Reputation: 604

Post » Thu Apr 23, 2015 4:15 pm

No problem. We all started somewhere ;)
B
15
S
5
G
7
Posts: 876
Reputation: 5,650


Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, DeXVinogradov, leena222, tatogame and 18 guests