<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d7109511\x26blogName\x3dmimimama+wawawa...\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dSILVER\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://mimimama.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://mimimama.blogspot.com/\x26vt\x3d-8327042964642446593', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Trigonometry 101



Macromedia® Flash™ MX Game Design Demystified: The Official Guide to Creating Games with Flash
By Jobe Makar, ISBN 0-201-77021-0

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...


lho heh lho heee... lha kok ketemu trigonometri maneh? diamputt, keliru milih buku!f

Labels: