We are missing one vital piece from our game: bricks to break. We want our game to be flexible enough that we will be able to define new levels without diving too deep into our source code, so we will be storing our levels as a property list (plist).
For our game, we want to have unlimited play, so we will define a set number of brick patterns, and the game will loop through these in order. When you reach the end, it will go back to the first pattern and repeat the cycle.
We define the patterns in the plist as an array with the name in the format P#
, so the patterns would be named P1
, P2
, P3
, and so on. Inside each array are the strings representing each row of bricks. The rows begin at the bottom, so Item 0 is the lowest row of bricks, and Item 1 would be above it, and so on.
If we were to build a level editor for our game, we would be more likely to build a more robust plist structure. Because we are hand coding the level design, the easiest way to organize the data is in...