Path Or Chase

5
Your rating: None Average: 5 (2 votes)
Difficulty Level: 
Beginner
Topic: 
Game Coding

Path Or Chase

The most common type of enemy movement could be the enemy that patrols on a defined path. When a player comes within a certain range or within sight of the enemy you may want the enemy to break off the path and head for the player.

This example file is well commented and shows a simple method for doing this. The enemy also returns to the path and continues on the patrol after 3 seconds. Of course the methods for starting and ending the chase are all dependent on your game. Hopefully this example gives you a bit to think about instead of abandoning your game idea.

Download Example File

Comments

Game_Master's picture
5

This is nicely commented like Jeff said. Five stars