How do I destroy tilemap?

Get help using Construct 2

Post » Wed Nov 30, 2016 11:12 pm

Hi guys.

Please have a look at this animation. Image
Tile map is changing, and player need 2 shots to destroy tile.. I wonder is it possible to make it in Construct 2?
B
18
S
6
G
3
Posts: 23
Reputation: 2,924

Post » Thu Dec 01, 2016 3:20 am

Bullet on collision with tilemap -> erase tile at (tilemap.positiontotile(bullet.x)),(tilemap.positiontotile(bullet.y))
That should destroy the tile where the bullet hits, although it may need some tweaking to work with your project. Maybe someone else can help with the two hits thing.
B
14
S
3
Posts: 55
Reputation: 912

Post » Thu Dec 01, 2016 7:45 am

You could use an array to check how many shots has the tilemap received:

bullet on collision with tilemap ->
check if array(bullet.x,bullet.y) is less than 1 ->
If it is, add 1 to position (bullet.x,bullet.y) in the array
If it isn't, destroy tilemap at position (bullet.x,bullet.y)

The hardest thing to do would add the automapping, which is a set of user-defined rules that change the tilemap like the gif you posted.
B
123
S
43
G
41
Posts: 847
Reputation: 28,206

Post » Thu Dec 01, 2016 10:13 am

Thanks guys, that's very helpful.
Yeah, automapping seems to be the hardest thing.
I will let know the progress.
B
18
S
6
G
3
Posts: 23
Reputation: 2,924


Return to How do I....?

Who is online

Users browsing this forum: ChoosyZerk, Google [Bot], Yahoo [Bot] and 48 guests