How to go other scene?

function kor1:touch(event)

   if (event.phase == “began”) and ( kor1.fill.r == 1 and kor1.fill.g == 0 and kor1.fill.b == 0 ) then 

   score = score + 1;

   playerScore.text = "Score: " … score

   else

   vege = false 

   composer.removeScene(“level1”)

   composer.gotoScene(“gameover”)

   print"vege"

   end

   

 end

 kor1:addEventListener(“touch”,kor1)

didn’t work , please help

Hello, Try this.

local function gotoNextScene(event) if event.phase == "began" then kor1:setFillColor( 1, 0, 0 ) score = score + 1; playerScore.text = "Score: " .. score else event.phase == "ended" then vege = false composer.removeScene("level1") composer.gotoScene("gameover") print("vege") end end kor1:addEventListener( "touch", gotoNextScene )

Good Luck!

Thanks, I try it !

Hello, Try this.

local function gotoNextScene(event) if event.phase == "began" then kor1:setFillColor( 1, 0, 0 ) score = score + 1; playerScore.text = "Score: " .. score else event.phase == "ended" then vege = false composer.removeScene("level1") composer.gotoScene("gameover") print("vege") end end kor1:addEventListener( "touch", gotoNextScene )

Good Luck!

Thanks, I try it !