Angles in computer games

The previous code told the monkey tower shoot a dart upwards each time you press on the game screen.

But what we really want the monkey to do is throw the dart wherever you press!

You're going to code that soon, but first you need to understand how computer games measure coordinates and work out angles.

Computer coordinates

We describe direction using angles. Here are the basic rules:

  • X is horizontal, pointing across the screen.
  • Y is vertical, pointing down the screen.
  • Coordinates are written (x,y).
  • The top left corner has the coordinates (0,0). You can call it the origin.
  • Angles rotate clockwise.
  • We count 0 degrees as right.

> When you are ready to continue, click NEXT STEP below.

results matching ""

    No results matching ""