Hi,
I am getting this error each time,the player loose and it switches to another scene.What is the matter?
local function gameOver (event) if event.phase == “began” then local options = { effect = “fromBottom”, time = 700, } composer.gotoScene (“levelOne”,options) composer.removeScene (“levelOne”) end end local function groundMovement (self,event) – The editor says that the error is at the first 2 lines of this function. if self.x <-365 then self.x = 823 else self.x = self.x - 3.7 end end
sand.enterFrame = groundMovement
Runtime:addEventListener (“enterFrame”,sand)
sand2.enterFrame = groundMovement
Runtime:addEventListener (“enterFrame”,sand2)
toothFish:addEventListener(“collision”,gameOver)
purpleFish:addEventListener(“collision”,gameOver)
blowFish:addEventListener(“collision”,gameOver)
blueFish:addEventListener(“collision”,gameOver)
greenFish:addEventListener(“collision”,gameOver)
Thanks!