so im trying to transition between a start menu to the game itself
when i click on start in the menu it transitions to the game but it doesnt display everything it only displays the background and one of the images i use to determine the amount of lives left
im currently transitioning my game from a testing file into the scene template file and well it wont display everything that i need (im just working on getting the look of the game right now so i havent added in anything other than the displays into the new scene file)
could someone please explain to me why this isnt working id be greatly appreciative
ive even followed a tutorial and i did exactly what it said to do to get it working but i still get the same issue
here is what i have in my game scene file
local composer = require( "composer" ) local scene = composer.newScene() -- ----------------------------------------------------------------------------------- -- Code outside of the scene event functions below will only be executed ONCE unless -- the scene is removed entirely (not recycled) via "composer.removeScene()" -- ----------------------------------------------------------------------------------- -- ----------------------------------------------------------------------------------- -- Scene event functions -- ----------------------------------------------------------------------------------- local gravity = .5 local hitPoints = 3 local timerNum = 0 local loop = 0 local hits = 0 local randomSpawn = math.random(3) local blueTime local greenTime local redTime = 1 local scoreNumber = 0 local background local platform local ball local scoreBoard local score local scoreVisual local life1 local life2 local life3 -- create() function scene:create( event ) local sceneGroup = self.view -- Code here runs when the scene is first created but has not yet appeared on screen background = display.newImageRect("background.png",320, 668 ) background.x = display.contentCenterX background.y = display.contentCenterY sceneGroup:insert(background) platform = display.newImageRect("Platform.png", 360, 35) platform.name = "platform" platform.x = display.contentCenterX platform.y = 505 platform.yScale = display.contentScaleY + 1 sceneGroup:insert(platform) ball = display.newImageRect("square.png", 50, 50) ball.name = "ball" ball.x = display.contentCenterX ball.y = display.contentCenterY sceneGroup:insert(ball) scoreBoard = display.newImageRect("scoreboard.png", 330, 35 ) scoreBoard.x = display.contentCenterX scoreBoard.y = -30 sceneGroup:insert(scoreBoard) score = display.newText( "Score: ", display.contentWidth - 270, display.contentHeight - 510, native.systemFontBold, 20 ) score:setFillColor(255, 255, 255) sceneGroup:insert(score) scoreVisual = display.newText( scoreNumber, 270, display.contentHeight - 510, {width = 128}, native.systemFontBold, 20, {align = "right"}) sceneGroup:insert(scoreVisual) life1 = display.newImageRect("square.png", 20, 20) life1.x = 15 life1.y = 0 sceneGroup:insert(life1) life2 = display.newImageRect("square.png", 20, 20) life2.x = 35 life2.y = 0 sceneGroup:insert(life2) life3 = display.newImageRect("square.png", 20, 20) life3.x = 55 life3.y = 0 sceneGroup:insert(life2) end -- show() function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Code here runs when the scene is still off screen (but is about to come on screen) elseif ( phase == "did" ) then -- Code here runs when the scene is entirely on screen end end -- hide() function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then -- Code here runs when the scene is on screen (but is about to go off screen) elseif ( phase == "did" ) then -- Code here runs immediately after the scene goes entirely off screen end end -- destroy() function scene:destroy( event ) local sceneGroup = self.view -- Code here runs prior to the removal of scene's view end -- ----------------------------------------------------------------------------------- -- Scene event function listeners -- ----------------------------------------------------------------------------------- scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) -- ----------------------------------------------------------------------------------- return scene