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

Time for action — rendering the launchers

To render all the launchers at once, call the function RenderLaunchers.

RenderCities()
RenderLaunchers()
Return True

What just happened?

With just a few calls, we have implemented the launcher class into the game and created, updated, and rendered each launcher.

Again, save the file and let it run. You should see two nice rocket launchers in your game. One of them would look like the following image. You will notice that there are also little lines for each rocket. Press A or S, and you will see them being removed, one by one.

What just happened?

Cool! The next thing we will add are the rocket launchers. You want to fire some ammunition, don't you? So here we go!