Hey,
Thanks a lot. I believe the problem is because I am not removing the images when they are off the screen. In my app I am propelling images on the screen. After a while it get’s laggy, so how can I remove the image after it goes off the screen?
THANKS!
Here is my code:
[code]
function fly()
flyRan = math.random(1,2)
if flyRan == 1 then
gopz = math.random(-2000, 2000)
local ted = display.newImageRect(“teddy.png”,200,200)
ted.x = -100
ted.y = math.random(150,250)
physics.addBody(ted,“dynamic”, {isSensor = true, density = .5})
ted:applyLinearImpulse(150, -170, ted.x, ted.y )
ted:applyTorque(gopz)
end
if flyRan == 2 then
gop = math.random(-2000, 2000)
local dice = display.newImageRect(“dice.png”,200,200)
dice.x = -100
dice.y = math.random(150,250)
physics.addBody(dice,“dynamic”, {isSensor = true, density = .55})
dice:applyLinearImpulse( 130, -170, dice.x, dice.y )
dice:applyTorque( gop)
end
end
workHUH = math.random(300,500)
row = timer.performWithDelay(workHUH, fly,0)
[/code] [import]uid: 23689 topic_id: 27081 reply_id: 110009[/import]