Proper ogre aiming

Today we’re going to revisit a classic problem: getting ogres to aim properly – varying their attack to correctly hit enemies at different distances and elevations. Previous attempts I’ve seen at solving this problem work by varying the projectile’s speed in order to affect a hit. This seems like an unfair advantage for the ogre to have – the player can only fire grenades at one speed and must vary her angles to score direct hits. We will try to create a function which calculates angles for the ogre to fire at, and then change the ogre grenade code to use those angles. Continue reading