O'Reilly logo

iOS Game Programming Cookbook by Bhanu Birani, Chhavi Vaishnav

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing wander

You might have observed very often in the game that few characters are just randomly moving around in their environment. These characters are waiting for some event to happen. For example, in any warfare game, the enemy soldiers are just wandering around in the castle to catch the player and they will keep on wandering till they find the player. Once the player is in the vicinity, then they will change their behavior to seek. So, the wandering ability of the characters makes them visually pleasant and realistic.

Making a game object follow the path will make it unrealistic and will affect the overall game play by making it more predictive. So these wandering behaviors add much more fun and realistic behavior to the game.

The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required