tilemap expressions, How do I delete tiles by touching them

Get help using Construct 2

Post » Mon Jan 12, 2015 10:20 am

I am having trouble getting tiles to delete from a tile map by touching them.

right now I have

touch, on touched tilemap1, tilemap1erase tile (tilemap1.PositionToTileX(self.x),tilemap1.PositionToTileY(self.y)

I am guessing my expressions are wrong but I am at a loss. I would be great full for any help on this.
B
5
S
1
Posts: 11
Reputation: 351

Post » Mon Jan 12, 2015 3:34 pm

From what I can tell, it is because you are referencing Self.X and Self.Y where you need to reference Touch.X and Touch.Y. Since the action is on the Tilemap, the Self object references the Tilemap X/Y instead of the Touch X/Y.

Using the Touch X/Y, I did a quick test and got the results I believe you are looking for so, making that simple change should solve your problem. Good luck with your project.
B
39
S
12
G
11
Posts: 331
Reputation: 7,727

Post » Mon Jan 12, 2015 3:59 pm

I think that's pretty neat.. Tried it myself and seems to work.
B
8
S
1
G
1
Posts: 96
Reputation: 632

Post » Mon Jan 12, 2015 4:42 pm

Thank you that worked great!
B
5
S
1
Posts: 11
Reputation: 351


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, db3344, Kermad and 8 guests