Hi everyone,
I’m attempting to add a runtime listener to a ninja star object after the user touches a button in the lower right hand corner of the screen. What I’m trying to do is add an enterFrame listener to the object so that when it reaches a certain point on the screen it will remove itself. I have made the object have its own attribute such as ninjaStar.type = “weapon” so that the runtime function looks for this and processes the removal.
Also I’m creating the object from two different external modules. One module contains the code to make the ninja star and the other is just a place for the object to be placed into for tracking purposes.
Here’s the chunk of code that is supposed to add the listener.
local function attack(event)
local startX, startY = character.x + 18, character.y
globalSpawn.weapons[1] = weapons.star(startX, startY)
Runtime:addEventListener(“enterFrame”, globalSpawn.weapons[1])
end
What I need to know is whether Corona has stipulations on when you can add runtime listeners.
Any help would be greatly appreciated!!!