please, Someone can help me??
I will copy and paste my 2 .lua files to you can see and search for an problem
my mainmenu.lua:
[code]module(…, package.seeall)
function new()
local localGroup = display.newGroup()
– Variaveis
local background
local start
local howToPlay
local credits
– Funcoes
local menu
local startFuncao
local startFade
local howToPlayFuncao
local howToPlayFade
local creditsFuncao
local creditsFade
menu = function()
– BackGround
background = display.newImageRect( “home_bg.png”, 480, 320 )
background.x = _W/2
background.y = _H/2
localGroup:insert( background )
– Escrita “escape”
textoEscape = display.newImageRect( “escape_titulo.png”, 136, 39 )
textoEscape.x = 340
textoEscape.y = 40
localGroup:insert( textoEscape )
– Escrita “escape”
textoHospital = display.newImageRect( “hospital_escape.png”, 164, 42 )
textoHospital.x = 390
textoHospital.y = 80
localGroup:insert( textoHospital )
– Start
botaoStart = movieclip.newAnim( { “start.png”, “start2.png” }, 68, 24 )
botaoStart.x = 330
botaoStart.y = 160
localGroup:insert( botaoStart )
– How To Play
howToPlay = movieclip.newAnim( { “howtoplay.png”, “howtoplay2.png” }, 165, 24 )
howToPlay.x = 390
howToPlay.y = 230
localGroup:insert( howToPlay )
– Credits
credits = movieclip.newAnim( { “credits.png”, “credits2.png” }, 91, 30 )
credits.x = 330
credits.y = 290
localGroup:insert( credits )
--------------\—//------------------\—//-----------------
---------------\-//--------------------\-//------------------
loadInventory()
– Funcoes
startFuncao = function()
director:changeScene( “loading” )
end
howToPlayFuncao = function()
director:changeScene( “howToPlay” )
end
creditsFuncao = function()
director:changeScene( “configuracoes” )
end
startFade = function()
botaoStart:play()
system.vibrate()
timer.performWithDelay( 500, function() botaoStart:stop(); end, 1 )
transition.to( botaoStart, { delay = 500, time = 1500, alpha = 0, onComplete = startFuncao } )
transition.to( localGroup, { delay = 1200, alpha = 0 } )
end
howToPlayFade = function()
howToPlay:play()
system.vibrate()
timer.performWithDelay( 500, function() howToPlay:stop(); end, 1 )
transition.to( howToPlay, { delay = 500, time = 1500, alpha = 0, onComplete = howToPlayFuncao } )
transition.to( localGroup, { delay = 1200, alpha = 0 } )
end
creditsFade = function()
credits:play()
system.vibrate()
timer.performWithDelay( 500, function() credits:stop(); end, 1 )
transition.to( credits, { delay = 500, time = 1500, alpha = 0, onComplete = creditsFuncao } )
transition.to( localGroup, { delay = 1200, alpha = 0 } )
end
--------------\—//------------------\—//-----------------
---------------\-//--------------------\-//------------------
– Touchs Listeners
botaoStart:addEventListener( “touch”, startFade )
howToPlay:addEventListener( “touch”, howToPlayFade )
credits:addEventListener( “touch”, creditsFade )
--------------\—//------------------\—//-----------------
---------------\-//--------------------\-//------------------
end
menu()
return localGroup
end [/code]
and now my configuracoes.lua:
module(…, package.seeall)
function new()
local creditGroup = display.newGroup()
local bg
bg = display.newImageRect( “home_bg.png”, 480, 320 )
bg.x = _W/2
bg.y = _H/2
creditGroup:insert( bg )
local textoResetaJogo
textoResetaJogo = display.newText( “Reset Game”, 350, 150, nil, 18 )
creditGroup:insert( textoResetaJogo )
local resetaGame
resetaGame = function(e)
if e.phase == “ended” then
reseta.somaReset()
end
end
local voltaa, voltarMenu
voltaa = display.newRect( 350, 280, 80, 50 )
creditGroup:insert( voltaa )
voltarMenu = function(e)
if e.phase == “ended” then
print( “aaaaa” )
director:changeScene( “mainmenu” )
end
end
textoResetaJogo:addEventListener( “touch”, resetaGame )
voltaa:addEventListener( “touch”, voltarMenu )
return creditGroup
end [/code]
when I touch in this Rect, I have “aaaa” in terminal… but director dont change the scene =SS
EDIT: sorry but the “code” dont work in secound script =T [import]uid: 23063 topic_id: 13259 reply_id: 49339[/import]