A lot of games use balls as their main objects. Pinball machines, marbles, break out, and of course sports games such as soccer, baseball, and many others. It is just natural to use them in computer games too. Everyone knows a ball and can predict how to use it or how it will behave. The game we will create together in this chapter is called
Balls Out!
It is heavily influenced by the classic game called BreakOut, which you will know if you are old enough. If you don't, then have a look at this link: http://en.wikipedia.org/wiki/Breakout_%28video_game%29
Another version of this kind of game is called Arkanoid (http://en.wikipedia.org/wiki/Arkanoid).
Balls Out!
doesn't have squared bricks for you to smash with your ball, but spheres, and that makes it rather tricky to control. Also, there won't be a paddle that controls your ball, but you will utilize the accelerometer of your iOS device and you will need to avoid some nasty fellows that run down the game field. If you collide with them, you are done!
As each game needs some eye candy, you will create some nice particle effects for your game and will learn how to display them. For this, you will create particle emitters, place them inside the game when needed, and control their behavior.
Together, we will go through the following topics:
Again, we will use the fantomEngine framework, which was created as an extra for this book and is available here at http://code.google.com/p/fantomengine/.
Make sure you use at least version 1.25 for this chapter. Under its hood, fantomengine
will import Mojo
so we don't need to import it ourselves.
18.189.178.237