Okay. Then I have another problem!
Before that, I took a particular problem, but now I will take all the app!
There are 3 file - the main level, a restart.
I ordered as you said, only after I press the restart button again and click on the screen for a shot - an error occurs!
Of course, I delete the data of the scene, but the scene is reset group? or I do not understand …

I googled and tried to fix it and made another name for the group to function, for example, “global group” and added it through the “insert” to “create a scene”
but it does not help.
MAIN
local composer = require "composer" composer.gotoScene( "level" )
LEVEL
local physics = require "physics" physics.setDrawMode( "hybrid" ) physics.start( ) local widget = require "widget" local composer = require "composer" local scene = composer.newScene() function onEventListener( event ) -- РЕСТАРТ if ( event.phase == "began" ) then composer.gotoScene( "restart" ) composer.removeScene( "level" ) end return true end function touch\_bullet (event) local sceneGroup = scene.view if ( event.phase == "began" ) then local s = display.newImage( "s.png", 400, 400 ) sceneGroup:insert( s ) s.isBullet = true physics.addBody( s, "dynamic", {density = 0.4, friction = 6} ) z = 480 - event.y s:setLinearVelocity( -200, -z\*1.5 ) end return true end -- create() function scene:create( event ) local sceneGroup = self.view local restart = display.newImage( "restart.png", 250, 0 ) sceneGroup:insert(restart) local pol = display.newImage( "pol.png", 160, 480 ) physics.addBody( pol, "static" ) sceneGroup:insert(pol) local p1 = display.newImage( "p.png" , 160, 426 ) physics.addBody( p1, "dinamic", { friction = 0.3, density = 0.01 } ) sceneGroup:insert(p1) local p2 = display.newImage( "p.png", 120, 426 ) physics.addBody( p2, "dinamic", { friction = 0.3, density = 0.01} ) sceneGroup:insert(p2) local p3 = display.newImage( "p.png", 200, 426 ) physics.addBody( p3, "dinamic", { friction = 0.3, density = 0.01} ) sceneGroup:insert(p3) local p4 = display.newImage( "p.png", 160, 380 ) p4.rotation = 90 physics.addBody( p4, "dinamic", { friction = 0.3, density = 0.01} ) sceneGroup:insert(p4) local p5 = display.newImage( "p.png", 140, 330) physics.addBody( p5, "dinamic", { friction = 0.3, density = 0.01} ) sceneGroup:insert(p5) local p6 = display.newImage( "p.png", 180, 330) physics.addBody( p6, "dinamic", { friction = 0.3, density = 0.01} ) sceneGroup:insert(p6) local p7 = display.newImage( "p.png", 160, 285) physics.addBody( p7, "dinamic", { friction = 0.3, density = 0.01} ) p7.rotation = 90 sceneGroup:insert(p7) Runtime:addEventListener( "touch", touch\_bullet ) -- СОБЫТИЕ ПУЛИ restart:addEventListener( "touch", onEventListener ) end -- show() function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then elseif ( phase == "did" ) then end end -- hide() function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then elseif ( phase == "did" ) then end end -- destroy() function scene:destroy( event ) local sceneGroup = self.view end -- ----------------------------------------------------------------------------------- -- Scene event function listeners -- ----------------------------------------------------------------------------------- scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) -- ----------------------------------------------------------------------------------- return scene
RESTART
local composer = require( "composer" ) local scene = composer.newScene() local composer = require( "composer" ) local scene = composer.newScene() -- create() function scene:create( event ) local sceneGroup = self.view end -- show() function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then elseif ( phase == "did" ) then composer.removeScene("restart") composer.gotoScene( "level", "fade" ) end end -- hide() function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then elseif ( phase == "did" ) then end end -- destroy() function scene:destroy( event ) local sceneGroup = self.view end scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) return scene