Well maybe I didn’t ask my question correctly. I can remove my background Images by using director class, but I can’t remove functions with director class. So my question is, how do you remove a function manually and how do you remove an Image manually?
here’s the function I want to end as soon as I touch a button.
[lua]local function sp ()
for s = 1, 1 do
rand = math.random( 100 )
if (rand < 60) then
p = display.newImage(“platform_1.png”);
p.x = 60 + math.random( 400 )
p.y = 690
physics.addBody( p, “kinematic”,{density = 1, friction = 0.3, bounce = 0.0} )
p.isFixedRotation = true
Velocity ()
bullet ()
else
p = display.newImage(“platform_1.png”);
p.x = 90 + math.random( 320 )
p.y = 690
physics.addBody( p, “kinematic”,{density = 1, friction = 0.3, bounce = 0.0} )
p.isFixedRotation = true
Velocity ()
bullet ()
end
end
end
local spawnPlatforms = timer.performWithDelay( 500, sp, 500 )[/lua]
Oh Ya, Thanks for responding! I really appreciate it! [import]uid: 70979 topic_id: 11952 reply_id: 43670[/import]