Hey all, I just started playing around with STI and find it's super easy to set up a map using Tiled. However, I want parts of my game to be procedural (for example, placing items at random locations) and I'm having a hard time adding items to the STI map after it's initialized. For example, I created a helper function to the bump.lua script to add new physics objects to the scene:
Code: Select all
bump_add = function(map, block, x,y,w,h)
map.bump_world:add(block, x,y,w,h)
end
But when I run it, I get an error saying that 'add' is a nil value. Has anyone had luck adding objects to a STI map at runtime? Is there something I'm missing? Or would it be better to maintain a separate map of objects, and just making sure you offset both maps together as the player moves?