Hey Everyone. I’m trying to add a “cut scene” into my app, by changing scenes after a level is selected, if there’s a comic to be shown. To accomplish this, I added a new entry into my level json info “hasComic”, which is then read, applied to the level markers. That’s all well and working, the problem is when I actually go to the scene. loads (my test line in scene create prints), but it doesn’t seem to stay there, as I would expect it to, and it continues on to the next scene in the program, which goes to the actual game board.
At this point, the new scene is very basic, just the test print and a display image in create:scene() and everything else is stock from the tutorial. Anywhere, here’s the relevant code:
if (hasComic == true) then composer.gotoScene("src.showComic","fade", 400) print( "has a comic" ) end
-- "scene:create()" function scene:create( event ) --print(event.params.index) local sceneGroup = self.view -- Initialize the scene here. -- Example: add display objects to "sceneGroup", add touch listeners, etc. print( "in the show comic scene" ) local comic = display.newImageRect( sceneGroup,"img//comics/l001comic.png", 320,390) comic.y = display.contentCentery comic.x = display.contentCenterX end