Ok, I’ve spent alot of time learning lua the past 5 months working on my project. However, I am brain dead right now and can’t seem to get a simple function to work lol. Someone please tell me what I’m doing wrong. I am displaying objects on the screen and when you touch them, it disappears. I can’t seem to make the objects disappear for some odd reason:
[lua]
local physics = require(“physics”)
physics.start()
local createCircle
local createCircle1
local tapCircle
createCircle = function()
local circle = display.newCircle(0, 0, 40)
circle.x = 200; circle.y = 140
physics.addBody(circle, “static”)
circle:addEventListener(“tap”,tapCircle)
end
circleTimer = timer.performWithDelay(2000, createCircle, 5)
createCircle1 = function()
local circle1 = display.newCircle(0, 0, 50)
circle1.x = 300; circle1.y = 250
physics.addBody(circle1, “static”)
circle1:addEventListener(“tap”,tapCircle)
end
circleTimer1 = timer.performWithDelay(3000, createCircle1, 7)
function tapCircle(event)
if event.phase == “ended” then
event.target:removeSelf()
end
end
[import]uid: 69494 topic_id: 30790 reply_id: 330790[/import]