Director Class problem

Hey everybody, im having a major problem with director class, the simulator is saying that there is a problem with INSERT on line 182 or the

 localGroup:insert(enemyBalloon)  

as well as also saying attempt to perform arthematic feild on X line 150 or 

local px,py = event.x-proj.x, event.y-proj.y  

this is also happening with Y. this is mainly happening when i am in the menu screen, switching to the play screen, then going back to the menu screen which the resolves in what i’m basically talking about. the code below this text is the game file. Can someone please help me!!!. i’m really annoyed about this bug.

module(..., package.seeall) -- Project: sticky balloons -- Description:&nbsp; -- -- Version: 1.0 -- Managed with http://CoronaProjectManager.com -- -- Copyright 2013 Harry Newton. All Rights Reserved. --&nbsp; new = function () local widget = require "widget-v1" widget.setTheme("theme\_ios") display.setStatusBar(display.HiddenStatusBar) local physics = require "physics" physics.start();physics.setGravity(0,1) physics.setDrawMode("normal") local localGroup = display.newGroup() local ox, oy = math.abs(display.screenOriginX), math.abs(display.screenOriginY) local cw, ch = display.contentWidth, display.contentHeight local stage = display.getCurrentStage() --------------------------------------------------------------------- --FOREGROUND OBJECTS -------------------------------------------------------------------- local background = display.newImage("background.jpg") localGroup:insert(background) local ground = display.newImage("floor.png") physics.addBody(ground,"static") ground.y = 480 localGroup:insert(ground) local turret = display.newImageRect("BalloonTurret.png",134,134) turret.x = 160 turret.y = 420 localGroup:insert(turret) ------------------------------------------------------------- ------------------------------------------------------------- local function buttonHit() &nbsp;&nbsp;&nbsp;&nbsp;director:changeScene("menu", "fade") &nbsp;&nbsp;&nbsp;&nbsp;display.remove(proj) &nbsp;&nbsp;&nbsp;&nbsp;display.remove(enemyBalloon) end local back = widget.newButton {style = "backSmall",label = "back", onRelease = buttonHit} localGroup:insert(back) local projFiring = false local proj local physicsData = (require "Balloon").physicsData(1.0) local function newProj() &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;proj = display.newImage("Balloon.png"); proj.x = turret.x ; proj.y = turret.y - 20 &nbsp;&nbsp;&nbsp;&nbsp;physics.addBody( proj, "dynamic",physicsData:get("balloon") ) &nbsp;&nbsp;&nbsp;&nbsp;proj.gravityScale = -7 &nbsp;&nbsp;&nbsp;&nbsp;projFiring = false &nbsp;&nbsp;&nbsp;&nbsp;proj.isBullet = true &nbsp;&nbsp;&nbsp;&nbsp;proj.isBodyActive = false &nbsp;&nbsp;&nbsp;&nbsp;proj.isVisible = false &nbsp;&nbsp;&nbsp;&nbsp; localGroup:insert(proj) &nbsp;&nbsp;&nbsp;&nbsp; end --collision handler local function projCollide( self,event ) &nbsp;&nbsp;&nbsp;&nbsp;if ( event.phase == "began" ) then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--get world coordinates of projectile for joint reference&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self:removeEventListener( "collision", self ) ; self.collision = nil &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--delay function to resolve collision &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local function resolveColl( timerRef ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( timerRef.source.action == "makeJoint" ) then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local weldJoint = physics.newJoint( "weld", self, event.other, self.x, self.y ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--check if velocity of projectile is sufficient to "stick" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local vx,vy = self:getLinearVelocity() &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local dirVel = math.sqrt( (vx\*vx)+(vy\*vy) ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( dirVel \> 100 ) &nbsp; then &nbsp;--if sufficient, stop velocity and trigger joint creation &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self:setLinearVelocity( 0,0 ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local t = timer.performWithDelay( 10, resolveColl, 1 ) ; t.action = "makeJoint" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else &nbsp;--if not sufficient, "break" projectile and create new &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local t = timer.performWithDelay( 10, resolveColl, 1 ) ; t.action = "none" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;end end local function touchAction(event) &nbsp;&nbsp;&nbsp;&nbsp;if ( event.phase == "began" and projFiring == false ) then &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;projFiring = true &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj.isBodyActive = true &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj.isVisible = true &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local px,py = event.x-proj.x, event.y-proj.y &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj:applyLinearImpulse( px/8, py/8, proj.x, proj.y ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj:applyTorque( 50 ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj.gravityScale = -7 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj.collision = projCollide ; proj:addEventListener( "collision", proj ) &nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;if (projFiring == true) then &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newProj() &nbsp;&nbsp;&nbsp;&nbsp;end end newProj() stage:addEventListener( "touch", touchAction ) local spawnTmr local spawnTime = 5000 local difficultyLevels = 4 local enemyBalloon = nil local function spawnEnemy() enemyBalloon = display.newImage("Balloon.png") physics.addBody(enemyBalloon,"dynamic", physicsData:get("balloon") ) localGroup:insert(enemyBalloon) if math.random(2) == 1 then &nbsp;&nbsp;&nbsp;&nbsp;enemyBalloon:applyTorque( 50 ) enemyBalloon.x = math.random(-100,-25) else enemyBalloon:applyTorque( -50 ) enemyBalloon.x = math.random(display.contentWidth+25,display.contentWidth +100) end enemyBalloon.x = math.random(display.contentWidth) enemyBalloon.y = -60 end --local spawnTimer = timer.performWithDelay(5000,spawnEnemy, 0 ) local function increaseDifficulty() &nbsp; &nbsp; &nbsp; &nbsp; if spawnTmr ~= nil then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timer.cancel(spawnTmr) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spawnTmr = nil &nbsp; &nbsp; &nbsp; &nbsp; end &nbsp; &nbsp; &nbsp; &nbsp;spawnTime = spawnTime - 500 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-- just to be safe, set this to whatever spawn rate would be the &nbsp; &nbsp; &nbsp; &nbsp;-- fastest, so game never spawns to fast &nbsp; &nbsp; &nbsp; &nbsp;if spawnTime \< 250 then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;spawnTime = 250 &nbsp; &nbsp; &nbsp; &nbsp;end &nbsp; &nbsp; &nbsp; &nbsp;-- spawn at this rate until this timer is canceled&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;spawnTmr = &nbsp;timer.performWithDelay(spawnTime, spawnEnemy, 0) &nbsp; &nbsp; end &nbsp; &nbsp; -- this timer loops only till spawning at most difficult speed is reached &nbsp; &nbsp; local difficultyTmr = &nbsp;timer.performWithDelay(5000, increaseDifficulty,difficultyLevels ) return localGroup &nbsp;&nbsp;&nbsp;&nbsp; end &nbsp;

cheers,hazza

The Director class may need to be updated to support Graphics 2.0, our new graphics engine that was released to the public with build 2076.  Director is a 3rd party product and not officially supported by Corona Labs.  Our official screen manager is known as Storyboard.  If putting:

graphicsCompatibility = 1

in your config.lua where the width and height are specified, doesn’t help you, you may need to did into the Directory library and make any required fixes or switch to Storyboard. 

Rob

does the corona simulator update automatically or do we have to put it in manually

so far it has been working up until this point

I’m not sure I understand your question about updating automatically?  As far as the Corona SDK product, you have to update it yourself when there is a new version.   Since you appear to be on a Starter account, the current version is 2076.  The previous version was 1202.  Director should work just fine on 1202.  There may be issues on 2076 that require Director to be updated.

If you mean the simulator automatically restarting/updating when you save your code, yes, it does, but you have to turn it on under the Preferences panel.

Rob

the real problem that im having is that some of the display objects from the game scene are poping up in the menu scene when i go back to the menu scene from the game scene

That problem is likely caused by you not inserting that display object into the scene’s localGroup.

Rob

I’ve double checked a million times to see if is inserted, and it is inserted properly, any other advice?. i sort of rearranged the code again , here it is

module(..., package.seeall) -- Project: sticky balloons -- Description:&nbsp; -- -- Version: 1.0 -- Managed with http://CoronaProjectManager.com -- -- Copyright 2013 Harry Newton. All Rights Reserved. --&nbsp; local localGroup function clean (event) &nbsp;&nbsp;&nbsp;&nbsp;print("cleaned") end new = function () local widget = require "widget-v1" widget.setTheme("theme\_ios") display.setStatusBar(display.HiddenStatusBar) local physics = require "physics" physics.start();physics.setGravity(0,1) physics.setDrawMode("normal") localGroup = display.newGroup() local ox, oy = math.abs(display.screenOriginX), math.abs(display.screenOriginY) local cw, ch = display.contentWidth, display.contentHeight local stage = display.getCurrentStage() --------------------------------------------------------------------- --FOREGROUND OBJECTS -------------------------------------------------------------------- local background = display.newImage("background.jpg") localGroup:insert(background) local ground = display.newImage("floor.png") physics.addBody(ground,"static") ground.y = 480 localGroup:insert(ground) local turret = display.newImageRect("BalloonTurret.png",134,134) turret.x = 160 turret.y = 420 localGroup:insert(turret) ------------------------------------------------------------- ------------------------------------------------------------- local function buttonHit() &nbsp;&nbsp;&nbsp;&nbsp;director:changeScene("menu", "fade") end local back = widget.newButton {style = "backSmall",label = "back", onRelease = buttonHit} localGroup:insert(back) local projFiring = false local proj local physicsData = (require "Balloon").physicsData(1.0) local function newProj() &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;proj = display.newImage("Balloon.png"); proj.x =160 ; proj.y = 420 - 20 &nbsp;&nbsp;&nbsp;&nbsp;physics.addBody( proj, "dynamic",physicsData:get("balloon") ) &nbsp;&nbsp;&nbsp;&nbsp;proj.gravityScale = -7 &nbsp;&nbsp;&nbsp;&nbsp;projFiring = false &nbsp;&nbsp;&nbsp;&nbsp;proj.isBullet = true &nbsp;&nbsp;&nbsp;&nbsp;proj.isBodyActive = false &nbsp;&nbsp;&nbsp;&nbsp;proj.isVisible = false &nbsp;&nbsp;&nbsp;&nbsp; localGroup:insert(proj) &nbsp;&nbsp;&nbsp;&nbsp; end &nbsp;local function spawnEnemy() &nbsp;&nbsp;&nbsp;&nbsp;local enemyBalloon = display.newImage("balloon2.png") physics.addBody(enemyBalloon,"dynamic", physicsData:get("balloon") ) enemyBalloon:setFillColor( 214, 0, 19 ) enemyBalloon:applyTorque( 50 ) enemyBalloon.x = math.random(0,320) enemyBalloon.y = -60 localGroup:insert(enemyBalloon) end --collision handler local function projCollide( self,event ) &nbsp;&nbsp;&nbsp;&nbsp;if ( event.phase == "began" ) then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--get world coordinates of projectile for joint reference&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self:removeEventListener( "collision", self ) ; self.collision = nil &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--delay function to resolve collision &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local function resolveColl( timerRef ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( timerRef.source.action == "makeJoint" ) then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local weldJoint = physics.newJoint( "weld", self, event.other, self.x, self.y ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--check if velocity of projectile is sufficient to "stick" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local vx,vy = self:getLinearVelocity() &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local dirVel = math.sqrt( (vx\*vx)+(vy\*vy) ) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( dirVel \> 100 ) &nbsp; then &nbsp;--if sufficient, stop velocity and trigger joint creation &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self:setLinearVelocity( 0,0 ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local t = timer.performWithDelay( 10, resolveColl, 1 ) ; t.action = "makeJoint" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else &nbsp;--if not sufficient, "break" projectile and create new &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local t = timer.performWithDelay( 10, resolveColl, 1 ) ; t.action = "none" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp;end end local function touchAction(event) &nbsp;&nbsp;&nbsp;&nbsp;if ( event.phase == "began" and projFiring == false ) then &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;projFiring = true &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj.isBodyActive = true &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj.isVisible = true &nbsp; &nbsp; &nbsp; &nbsp; local px,py = event.x-proj.x, event.y-proj.y &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj:applyLinearImpulse( px/8, py/8, proj.x, proj.y ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj:applyTorque( 50 ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj.gravityScale = -7 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;proj.collision = projCollide ; proj:addEventListener( "collision", proj ) &nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;if (projFiring == true) then &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newProj() &nbsp;&nbsp;&nbsp;&nbsp;end end newProj() background:addEventListener( "touch", touchAction ) --------------------------------------------------------------------------------------------------------------- --NEED TO PUT LOCAL GROUP AFTER X AND Y COORDINATES, SO I HAVE TO REWRITE THE FUNCTION ---------------------------------------------------------------------------------------------------------------z local spawnTmr local spawnTime = 5000 local difficultyLevels = 4 --local spawnTimer = timer.performWithDelay(5000,spawnEnemy, 0 )---- THIS IS AN &nbsp;INFINITE LOOP HARRY ,U MUST YOU'SE THIS A LOT local function increaseDifficulty() &nbsp; &nbsp; &nbsp; &nbsp; if spawnTmr ~= nil then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timer.cancel(spawnTmr) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; spawnTmr = nil &nbsp; &nbsp; &nbsp; &nbsp; end &nbsp; &nbsp; &nbsp; &nbsp;spawnTime = spawnTime - 250 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-- just to be safe, set this to whatever spawn rate would be the &nbsp; &nbsp; &nbsp; &nbsp;-- fastest, so game never spawns to fast &nbsp; &nbsp; &nbsp; &nbsp;if spawnTime \< 250 then &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;spawnTime = 250 &nbsp; &nbsp; &nbsp; &nbsp;end &nbsp; &nbsp; &nbsp; &nbsp;-- spawn at this rate until this timer is canceled&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;spawnTmr = &nbsp;timer.performWithDelay(spawnTime,spawnEnemy, 0) &nbsp; &nbsp; end &nbsp; &nbsp; -- this timer loops only till spawning at most difficult speed is reached &nbsp; &nbsp; local difficultyTmr = &nbsp;timer.performWithDelay(5000, increaseDifficulty,difficultyLevels ) return localGroup &nbsp;&nbsp;&nbsp;&nbsp; end &nbsp;

Where are you killing your spawn timer?  It looks like it’s still running even after changing scenes…

Rob

how would i fix that?

i thinks storyboard seems like a more logical solution, i think im gona switch

put timer.cancel(spawnTmr) in your clean function, though you will need to move the “local spawnTmr” line to somewhere before your clean function.

Rob

were should i pt the clean function in my code?

does it matter were i put my clean function?

Again, Director isn’t supported, but I think it goes inside the new function.  I would look at some Director tutorials or other code samples that use it.

Rob

The Director class may need to be updated to support Graphics 2.0, our new graphics engine that was released to the public with build 2076.  Director is a 3rd party product and not officially supported by Corona Labs.  Our official screen manager is known as Storyboard.  If putting:

graphicsCompatibility = 1

in your config.lua where the width and height are specified, doesn’t help you, you may need to did into the Directory library and make any required fixes or switch to Storyboard. 

Rob

does the corona simulator update automatically or do we have to put it in manually

so far it has been working up until this point

I’m not sure I understand your question about updating automatically?  As far as the Corona SDK product, you have to update it yourself when there is a new version.   Since you appear to be on a Starter account, the current version is 2076.  The previous version was 1202.  Director should work just fine on 1202.  There may be issues on 2076 that require Director to be updated.

If you mean the simulator automatically restarting/updating when you save your code, yes, it does, but you have to turn it on under the Preferences panel.

Rob

the real problem that im having is that some of the display objects from the game scene are poping up in the menu scene when i go back to the menu scene from the game scene