Hi!
I read too much about this subject, but i can’t find solution to my problem
function envirement()
(...)
local reset = display.newImage("\_img/reset.jpg",900,100,true)
reset.id = resetuje
Gra:insert(reset)
reset:addEventListener("touch", init )
end
function level1()
envirement()
--result(solidTotal, pins)
setCueball(100,\_H/2)
setPinPoz(300, 150)
setPinPoz(300, 600)
setPockets(700,400)
end
function splash()
splashGroup = display.newGroup()
local splashBG = display.newImage("\_img/tlo1.png", true, 20, 1, true)
splashGroup:insert(splashBG)
local btnplay = display.newImage( "\_img/graj.png", 200, 550, true)
btnplay.id = play
splashGroup:insert(btnplay)
btnplay:addEventListener("touch", init)
end
function init( event )
mode = event.target.id
if mode == play then
print "splash"
339.splashGroup:removeSelf()
timer.performWithDelay(0, level1, 1)
elseif mode == resetuje then
print "level"
344.Gra:removeSelf()
timer.performWithDelay(0, splash, 1)
end
end
splash()
Corona simulator output give me :
splash
level
Runtime error d:\aacorona\gra\main.lua:344: attempt to index global 'Gra' (a nil value ) stack traceback:
[C]: ? d:\aacorona\gra\main.lua:344: in function <d:> <br>?: in function <?:229> splash Runtime error d:\aacorona\gra\main.lua:339: attempt to call method 'removeSelf' (a nil value) <br>stack traceback: <br>[C]: in function 'removeSelf' d:\aacorona\gra\main.lua:339: in function <d:> <br> ?: in function <?:229> <br>splash <br>Runtime error d:\aacorona\gra\main.lua:339: attempt to call method 'removeSelf' (a nil value) <br>stack traceback: <br>[C]: in function 'removeSelf' d:\aacorona\gra\main.lua:339: in function <d:> <br> ?: in function <?:229><br> [import]uid: 117910 topic_id: 35315 reply_id: 335315[/import] </d:></d:></d:>
Thanks a lot for yout time and patience! It’s work! [import]uid: 117910 topic_id: 35315 reply_id: 140393[/import]