You can now add items to your maps. It is possible to carry an item to another map. For now, you can make locked doors, quest-giving NPCs and treasure chests.
Any tile can give an item to the player when that player steps on it. To do that, simply put a "give" attribute in the tile's definition:
[c] tile = . sprite = chest.png give = treasure
You can use any name you want. As soon as the player steps on that tile or bumps into it, the item will be added to the inventory.
Disappearing and changing shape
Sometimes you want the item to disappear from the map after being picked up, or the chest to change its graphics to an open chest. You can do it with the "give_sprite" parameter:
[c] tile = . sprite = chest.png give = treasure give_sprite = open_chest.png
If the parameter contains a name of a sprite image, the sprite will change its looks into that. If the parameter is empty, the sprite will be removed.
[k] tile = . sprite = key.png give = key give_sprite =
You can also change the message that the tile displays by using "give_message".
There is little sense in collecting items if you can't do anything with them. For now all you can do with items is unlocking things. If you use the "unlock" parameter in a tile definition, it will be only passable when the player has the specified item. You can also add an "unlock_sprite" parameter, to make the sprite change its looks when the player unlocks it, and "unlock_message" to change the message.
[B] tile = . sprite = locked.png unlock = key give_sprite = open_bars.png
You can combine the "give" and "unlock" parameters – the item will not be given until the tile is unlocked.
[c] tile = . sprite = chest.png give = treasure give_sprite = open_chest.png unlock = key give_sprite = open_chest.png