Question About tilemaps

Get help using Construct 2

Post » Sat Nov 16, 2013 1:51 am

I Want to make a individual tilemap "block" destroyable, how to make this?

i have tried "On Left button Clicked on [TILEMAPNAME] - [TILEMAPNAME] Destroy"

But this destroy all the tilemap, how to destroy ONLY one block of tilemap?

And i want many "blocks destroyable" :v

Sorry my bad English D:
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Sat Nov 16, 2013 2:15 am

Assuming your tiles are 32x32 in size...

+On clicked
-Erase tile Mouse.X/32 , Mouse.Y/32MadFactory2013-11-16 02:20:05
Image
B
242
S
29
G
13
Posts: 1,787
Reputation: 18,685

Post » Sat Nov 16, 2013 2:30 am

Here is my thread I've created about efficent destroyable tiles.

http://www.scirra.com/forum/open-source-destroyable-tiles_topic80552.html
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Sat Nov 16, 2013 1:49 pm

@MadFactory - if you're using the Tilemap object, you should definitely use the Tilemap.PositionToTileX/Y expressions instead.
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,228

Post » Sat Nov 16, 2013 2:21 pm

Thanks, Joannesalfa! And how to make to only destroy block if it is on Line of Sight of the player? (Only the block, and not all the tilemap?)

Thanks!
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Sat Nov 16, 2013 5:43 pm

Anyone can help me?
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Sat Nov 16, 2013 10:00 pm

If the player has line of sight to the tile's position, then erase the tile.
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,228

Post » Sat Nov 16, 2013 11:03 pm

Like this?
LOS TO POSITION:

X Tilemap.TileToPositionX(500)

Y Tilemap.TileToPositionY(500)
?

Because this didn't worked
B
9
S
1
Posts: 75
Reputation: 1,118

Post » Fri Jan 24, 2014 1:03 am

X Tilemap.TileToPositionX(Mouse.X)

Y Tilemap.TileToPositionY(Mouse.Y)
B
48
S
5
G
6
Posts: 210
Reputation: 6,277


Return to How do I....?

Who is online

Users browsing this forum: khelaghor, R0J0hound and 6 guests