I had recently known Cocos2D when SpriteKit was introduced in the iOS SDK shortly after. At that point I immediately moved to this new tool and realized that, after all, it was very similar to Cocos2D so I should not have made great efforts to acquire the necessary knowledge to develop something with it.
It was the period in which I had sold some products to sellon the CodeCanyon website and therefore I used the opportunity to learn along the way.
It is easy to take inspiration from famous games, and is also a good strategy when creating something for people who want to distribute their app through the store, without having to rewrite it from scratch.
For this reason I set to work to develop a clone of that genre of games in which the player must bounce a ball against the bricks of a wall to destroy them.
Having to develop a product that can be easily customized I have devised a system for defining the appearance of the walls of each level.
It’s all very simple, the wall is treated as an array of elements and each one can take on a numeric value that corresponds to one of the brick types defined in the program. The developer can then create a huge number of different levels.
The code is designed to allow you to add other types of blocks besides those available. The developer can then create new ones in appearance, but also in behavior (for example, allowing them to resist a certain number of strokes before being destroyed).
As in many versions of this type of game, the player can capture power-ups that are released from destroyed blocks, in the form of objects falling down.
The code offers these types of power-ups:
- Super ball – The ball will not be stopped by the the collision with the bricks and continues on its way
- Capsule enlarge – This makes the player’s capsule larger
- Magnetized capsule – Will block the ball when hits the capsule, the player can release the ball when he wishes.
- Capsule shrink – The capsule will be smaller (It’s not really a power-up)
- Ball slowdown – The speed of the ball is reduced for a short period of time
- Capsule movement inversion – It will make the game harder to play
The entire application is structured on the basis of three screens. First a main menu which has the functions of allowing players to start a new game and showing the highest score obtained.
Then there obviously is a game screen where the gameplay itself takes place
Finally an interstitial menu that can be called up by the player by clicking on the “pause” button at the top right corner of the screen, or by the operating system itself in case of need. The menu allows you to resume the game or leave a game in progress.
BrickBreaker Game Kit for iOS on Codecanyon