I currently have 3 scenes…in my game app… the game usually starts with a “startpage” this page contains 3 buttons … 1. Play (to load the game scene) ,2. Help(to Load the help scene 3. credits(to load the credits scene)
the issue is
- when I click the play button instead of the game scene to come up, the credits scene comes up
- when i click the help button the instead of help to come up, the credits scene comes up instead of help scene.
- when i click the credits button the credit scene comes up.(works well here)
Code:
START PAGE.lua
module(…, package.seeall)
function new()
local localGroup = display.newGroup()
local background = display.newImage(“background1.png”)
local b_play = display.newImage(“buttons/button.png”)
b_play.x = 190
b_play.y = 190
b_play.Scene = “help”
local b_help = display.newImage(“buttons/help.png”)
b_help.x = 190
b_help.y = 250
b_help.Scene = “help”
local b_thanks = display.newImage(“buttons/thanks.png”)
b_thanks.x = 190
b_thanks.y = 310
b_thanks.Scene = “help”
function changeScene(e)
if (e.phase == “ended”) then
director:changeScene(e.target.Scene)
end
end
localGroup:insert(background)
localGroup:insert(b_play)
localGroup:insert(b_help)
localGroup:insert(b_thanks)
b_play:addEventListener(“touch”, changeScene)
b_help:addEventListener(“touch”, changeScene)
b_thanks:addEventListener(“touch”, changeScene)
return localGroup
end
CREDITS SCENE
module(…, package.seeall)
function new()
local localGroup = display.newGroup()
local background = display.newImage(“background1.png”)
localGroup:insert(background)
return localGroup
end
HELP SCENE
module(…, package.seeall)
function new()
local localGroup = display.newGroup()
local background = display.newImage(“background1.png”)
localGroup:insert(background)
return localGroup
end
Can sum1 Plz HELP??
[import]uid: 202019 topic_id: 37091 reply_id: 67091[/import]