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

Time for action — updating the launchers

To update all the launchers at once, call the function UpdateLaunchers, inside the UpdateGame method.

Method UpdateGame()
UpdateLaunchers()
Return True

What just happened?

The call of UpdateLaunchers in the game will check if their trigger keys were hit in each of existing rocket launchers, and then will fire a rocket.

Enhancing the UpdateMenu method

Now that we have the city and the launcher classes implemented, we can also finish the UpdateMenu method.