Hey I need help on something this may sound complicated I will try to best explain. Ok so basically what I’m trying to do is have an object be destroyed if there to far away from something. Like example the ball is chasing a block. The ball is 200 feet away from the block. What I’m trying to do is if the block ball becomes further away from the block the game is over.
This is how I tried to do with the code
local function destroy()
if (ball.x \> object.x) then
display.removeSelf(ball)
end
end
Runtime:addEventListener( "enterFrame", destroy )
I know is wrong. Can anyone please help me help is really appreciated
[import]uid: 17058 topic_id: 21414 reply_id: 321414[/import]