jMonkeyEngine 3.0 Beginner’s Guide
上QQ阅读APP看书,第一时间看更新

How to steer spatials

Now your users can trigger game actions and select targets. But a video game also follows an internal rhythm and generates its own events—new enemies spawn and plot a path towards the player base, a timer ignites explosives, a dungeon door falls shut, and so on. How do you implement computer-controlled events that need to be updated in every frame of the game?

Look at the Main.java template of the SimpleApplication class again—there is a mysterious method that we have not yet used, the simpleUpdate() method. Let's find out what it does!