Why Learn Trigonometry?


When programming a game, you'll often need to do things like find the distance between two points or make an object move. (In fact, very often!) Here are a few examples:

  • Rotating a spaceship or other vehicle

  • Properly handling the trajectory of projectiles shot from a rotated weapon

  • Calculating a new trajectory after a collision between two objects such as billiard balls or heads

  • Determining if a collision between two objects is happening

  • Finding the angle of trajectory (given the speed of an object in the x direction and y direction)

You are going to use trigonometry within ActionScripts to complete these (and many other similar) tasks. While you may not need to do so in every single game, the requirement for trigonometry can pop up in any genre. In this chapter I'll discuss the major uses of trigonometry in Flash and how to apply them.



Macromedia Flash MX Game Design Demystified(c) The Official Guide to Creating Games with Flash
Macromedia Flash MX Game Design Demystified: The Official Guide to Creating Games with Flash -- First 1st Printing -- CD Included
ISBN: B003HP4RW2
EAN: N/A
Year: 2005
Pages: 163
Authors: Jobe Makar

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net