Change map with AdvTiledLoader

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
munchor
Prole
Posts: 39
Joined: Sun Jun 10, 2012 4:28 pm

Change map with AdvTiledLoader

Post by munchor »

Hey there,

I have a map with some objects that the player can catch. When the player catches them, I want to delete them. How can I change a tile using AdvTiledLoader? Like, if it has a certain tile, I want it to become nil.

Thank you.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Change map with AdvTiledLoader

Post by Kadoba »

You can use layer.tileData:set(x, y, value) to set the value of an individual tile. See grid on the ATL wiki.
munchor
Prole
Posts: 39
Joined: Sun Jun 10, 2012 4:28 pm

Re: Change map with AdvTiledLoader

Post by munchor »

Kadoba wrote:You can use layer.tileData:set(x, y, value) to set the value of an individual tile. See grid on the ATL wiki.
But will it change the .tmx as well, or is it temporary? Thank you.
User avatar
SimonLarsen
Party member
Posts: 100
Joined: Thu Mar 31, 2011 4:47 pm
Location: Denmark
Contact:

Re: Change map with AdvTiledLoader

Post by SimonLarsen »

munchor wrote:
Kadoba wrote:You can use layer.tileData:set(x, y, value) to set the value of an individual tile. See grid on the ATL wiki.
But will it change the .tmx as well, or is it temporary? Thank you.
It will only change the map in memory, not the TMX-file.
munchor
Prole
Posts: 39
Joined: Sun Jun 10, 2012 4:28 pm

Re: Change map with AdvTiledLoader

Post by munchor »

Thank you!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 53 guests