I implemented SpriteKit the first time for this game. SpriteKit is Apple’s fast and easy toolkit designed specifically for 2D games. The game I did is called Pachinko or “Peggle”.

I inserted the background, placed the rainbow bouncers on their place and added red and green slot bases that would later count the score. They are programmed to spin which gives them a fun animation. First the balls just fell wherever I click and didn’t disappear in the slot bases.

I gave the slot bases values – either a negative point for red or positive one for green. I also gave the condition that when ball touches the base they would collide. I enabled a score count that would count how often a ball collides with a green or a red base that would also count in negative numbers.

You can now also add colorful rectangles to the game that would appear wherever you click in a various order, size and color. These rectangles can be added by clicking “Edit”. These rectangles serve as blocks for the balls. They would not fall through them, but rather bounce back. Furthermore are the balls now falling from the very top edge only, but still stick wherever you click on the x-axis.

To add some more effects and animation I modified the collision when balls disappear. I added fire and particles, that would move and disappear when a ball collides and sparkle a little bit.

Even though the game is only 2D, these effects make the game fun and entertaining.

 

You can view the code on GitHub here.

Franziska