Let's add in the display objects the player will see while in game play:
After the
loadGame()
function, we're going to create another function that will display all our game objects on screen. The following lines will display the art assets that were created for this tutorial:function addGameScreen() background = display.newImage("bg.png", 0, 0, true ) background.x = _W background.y = _H paddle = display.newImage("paddle.png") paddle.x = 240; paddle.y = 300 paddle.name = "paddle" ball = display.newImage("ball.png") ball.x = 240; ball.y = 290 ball.name = "ball"
Next, we'll add in the text that will display the score and level number during the game:
scoreText = display.newText("Score:", 25, 10, "Arial", 14) scoreText:setFillColor( 1, 1, 1 ) scoreNum = display.newText("0", 54, 10, "Arial", 14) scoreNum: setFillColor( 1, 1, 1 ) levelText = display.newText("Level:", 440, 10, "Arial", 14) levelText:setFillColor( 1, 1,...