hey so watch this video and help me out on fixing the problem!? thanks!
heres the code in that game.lua file
local composer = require( "composer" ) local scene = composer.newScene() local physics = require( "physics" ) physics.start( ) physics.setDrawMode( "hybrid" ) function scene:create( event ) local sceneGroup = self.view local BackGround = display.newImageRect("BackGround.png", 1080, 1920) end function scene:show( event ) local sceneGroup = self.view local phase = event.phase if ( phase == "will" ) then print("test") elseif ( phase == "did" ) then print("testtest") local floor = display.newImageRect("floor.png", 351, 32) floor.x = display.contentWidth \* 0.5 floor.y = 510 --physics.addBody( floor, "static" ) ----------------------------------------------- local circle = {} local spawnCircles = function () local FallDown = math.random(display.contentWidth \* 0.2, display.contentWidth \* 0.8 ) circle = display.newImageRect("circle.png", 31, 31 ) circle.x = FallDown circle.y = -70 physics.addBody( circle, "dynamic", {density = .01, friction = 0.5, bounce = 0.1 }) circle.gravityScale = 0.1 physics.setGravity( 0, 10 ) --circle:addEventListener( "touch", dragCircle ) --circle:addEventListener( "collision", circle ) end myTimer = timer.performWithDelay( 2000, spawnCircles, -1) --1000 is the time end return scene end -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) -- ------------------------------------------------------------------------------- return scene
