Hello to all nice people in this community)
im trying to do do two columns of objects and if i touch one of them then it will removeself… any help is appreciated
thats what i got now:
local physics = require("physics")
physics.start()
physics.setGravity(0,0)
local enemies = {}
local function die(e)
if(e.phase == "ended") then
enemies[i]:removeSelf()
end
end
for i=1, 3 do
for j =1,4 do
enemies[i] = display.newImage("apple.png", 190 - (i\*7), 220-(j\*8))
physics.addBody(enemies[i], { density=0.2, friction=0.1, bounce=0.5 } )
enemies[i]:addEventListener("touch",die)
end
end
Terminal is typing about event listener… [import]uid: 16142 topic_id: 11900 reply_id: 311900[/import]