The bricks are the last of the game objects we need to add in for this application. We'll be creating two different levels for this game. Each one will have a different brick layout from the other.
We're going to create the function for the first level. Let's create a new function,
gameLevel1()
. We will also set thecurrentLevel = 1
since the application begins at Level 1. Then we'll add in thebricks
display group and set ittoFront()
so that it appears in front of the game background.function gameLevel1() currentLevel = 1 bricks:toFront()
Next, add some local variables that will show how many rows and columns of bricks will be displayed on screen and where in the playing field each brick...