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!

Get jMonkeyEngine 3.0 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.