Reset Code

Hello. I am pretty good with corona. I have made a simple game that requires there to be some spawning
units. I got it to work and then when I click one it will create a reset button. when I hit it, it will take me to my main menu but in the corner the object pile up. and stay there like a image. How do I get rid of it. Do I need to reset different?

[code]
function changeScene(e)
if(e.phase == “ended”) then
director:changeScene(e.target.scene)
end
end

local deathMove = function( event )
local t = event.target
local phase = event.phase

if(event.phase==“began”) then
score = 0
local cloud = display.newImage(“cloud.png”)
localGroup:insert(cloud)
cloud.x = 300
cloud.y = 512
cloud.scene = “loadmainmenu”
cloud:addEventListener(“touch”, changeScene)
end
[/code] [import]uid: 55737 topic_id: 11246 reply_id: 311246[/import]

Do you have the lines for director at the start and end of that file?

Peach :slight_smile: [import]uid: 52491 topic_id: 11246 reply_id: 40790[/import]

@gupte3,
an image remaining behind when using Director would only mean that the image is not in the group that is being removed when the scene is being changed. Check the spawning code and ensure that the units are added to the appropriate group.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 11246 reply_id: 40836[/import]