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

Time for action — rendering the bombs

Add a call to the function RenderBombs, inside the RenderGame method.

RenderLaunchers()
RenderRockets()
RenderExplosions
RenderBombs
Return True

What just happened?

We have just implemented a call to our wrapper function RenderBombs. As you can see, implementing new objects into the game is easy.

If you let the game run, you will see some neat bombs falling from the sky, as shown in the following screenshot:

What just happened?

Creating new bombs and checking for GameOver conditions, or new level conditions

Right now, we can update and render bombs. But how do they appear? For this, we need to modify the UpdateGame method of the RocketCommander class. Also, we want to check if the game is over or the next level has been reached.