What You’ll Learn in This Hour
• How to calculate velocity from any direction
• How to move based on rotation angle
• How to calculate the angle to a target
• How to make final changes to the Android game engine
This hour expands on the concepts learned in the last two hours—dealing with transforms and collision detection—to move objects in any direction based on velocity of an angle. We will derive the math calculations needed to move a sprite in any desired direction based on its rotation angle (from a top-down perspective). Moving a sprite at a desired angle is a very important need in most games, so you will no doubt use this technique extensively in your own projects. The next related ...