Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Right now, our display objects are rather stagnant. In order for gameplay to initiate, we have to activate physics for the paddle and ball in order for any kind of movement in the game to occur.
gameLevel1() function, create a new function called startGame().function startGame()
physics.addBody(paddle, "static", {density = 1, friction = 0, bounce = 0})
physics.addBody(ball, "dynamic", {density = 1, friction = 0, bounce = 0})
"tap" event for startGame(). Close the function with end. background:removeEventListener("tap", startGame)
end