I am still new to Lua and Corona SDK and I’m trying to reload a scene using this reload.lua file but the problem I have is once the game reloads it doesn’t destroy the scene properly keeping an existing copy of the game therer which means everything is double on the screen.
Reload.lua :
local composer = require("composer") local scene = composer.newScene() ----------------------------------------- -- Reload The Game -- composer.removeScene( "scenes.game" ) composer.gotoScene( "scenes.game" ) ----------------------------------------- return scene
I’m very new to game development using Lua and Corona not had any experience at all! Thanks if someone could point me in the right direction!
What you can do is to put the graphics that you want to ‘reload’ in a displayGroup.
When the user selects ‘replay’, you just remove the displayGroup (using display.remove() function), then redraw them. In this way, you don’t need to reload the scene.
What you can do is to put the graphics that you want to ‘reload’ in a displayGroup.
When the user selects ‘replay’, you just remove the displayGroup (using display.remove() function), then redraw them. In this way, you don’t need to reload the scene.