Monkey Game Development:Beginner's Guide
上QQ阅读APP看书,第一时间看更新

The game objects

Each game is made of some objects. These can be images, or sounds, but also complex structures, such as a game character and its abilities. In our game, we have a few objects, as follows:

  • The cities we have to defend
  • The rocket launchers that will fire our rockets
  • The rockets themselves
  • The bombs that will fall down on our precious cities and try to destroy them
  • Explosions that will show up once a rocket bursts into pieces (the particle clouds from these explosions will be the real harm to the bombs; if they collide with an explosion cloud, the bombs will be destroyed)

There are few more elements/objects to the game, such as the game UI (score, background, and so on), but we will concentrate on the ones just listed. Each object will be built with a separate class.