at the end the best solution in found is to “delete” the previus scene when entering the one selected :
this is my LEVEL1.lua code
i put in every lvl the remove scene comand.
the object must be NOT declared local.
When you put objects into the group that is himself local
they will be deleted on exit screen or when called the removescene “command”
LVL1.lua
display.setStatusBar ( display.HiddenStatusBar )
local physics = require(“physics”)
local storyboard = require (“storyboard”)
local scene = storyboard.newScene()
function scene:createScene(event)
previous_scene = storyboard.getPrevious()
storyboard.removeScene( previous_scene )
screenGroup = self.view
-------------Creation of the level ----------------------------------------
Asse1 = display.newImage(“Asse480x30viti.png”)
screenGroup:insert(Asse1)
physics.addBody( Asse1,“static”, WOODDATA )
Asse1.x = Asse1.contentWidth/2
Asse1.y = display.contentHeight /2 -100
Asse1.rotation = 0
Asse1.alpha = 1
Asse1.isSleepingAllowed = ITEMSTATUS
.
.
.
end