Dear Corona community,
I have been playing around with Corona for some time now, trying to build a jump 'n run game based on the Sticker Knight template.
Sticker Knight as you might know uses the Ponytiled library to read Tiled maps. I am looking for a way to add new objects to the map while playing, like for enemies dropping items and such. I can’t seem to find out how to do that as I can’t figure out how to access the display groups of the map to insert new objects.
The map is stored in a variable called “map” like his:
map = tiled.new( mapData, “scene/game/levels” )
Is it possible to access the individual display groups (aka map layers) “inside” the map data during the game and add new objects?
Any explanation or tips on how to do this would be greatly appreciated.
Thanks
ktgt
Using your suggestion, I managed to insert an image into the correct map layer. I made a new function inside ponytiled.lua like below and called that function from game.lua (in my test scenario I simply called it via a button), which works well.