hey,
let’s say I have an object that spawns on the screen moving upward, I want the object to be removed when object.y = -70
here’s an example for the code I made
[lua]local storyboard = require (“storyboard”)
local scene = storyboard.newScene()
function scene:createScene(e)
local screenGroup = self.view
function spawnObject ()
local object = display.newImage(“object.png”)
object.x = centerX; object.y = 500;
transition.to(object, {time = 1000 , y = -70}
function removeObjectOntouch (e)
if e.phase == “ended” then
object:removeSelf()
end
end
object:addEventListener(“touch”, removeObjectOntouch)
end
end[/lua]
now this works fine, but what if I want the object to be removed when object.y = -70 ?
what should I add ? I tried many ways to do it but I couldn’t succeed with it.
what do you think I should do ?