Recipe: Waypoints Manager
7.1 Waypoint System
Both the racing game Motor Vehicle Doom and the shoot ’em up Interstellar Paranoids will need waypoints for the AI players. In Motor Vehicle Doom, we use waypoints for the AI and also for the main player for the following reasons:
- To check that the main player is heading in the right direction. The car controller code will track the player’s position on the track (based on which waypoint has been passed) and check its forward vector to make sure that it is facing the next waypoint along the track. If the player’s forward vector is not within a certain tolerance angle, the game will ...