1 Reply Latest reply on May 8, 2007 7:45 AM by Newsgroup_User

    Need Help!!! CAR RACING game

    ac_online
      ive been making a car racing type game, and ive managed designing the levels, made character, added if (Key.isDown(Key. -x-)
      statmentsd to move down and up and ive added rotation for left and right…
      it all works perfect ( no syntax errors)
      but when using up and down keys it uses the default north and south.. i want to know how to get it going forward and back but the way the car is actually facing….. i need to make the car move ( up/down/rightrotate/left rotate) the way he is looking at that moment... how do i set where the front and the back is... plz help

      this is a better explained copy of a previous post

      any help appreciated...

      Andy
        • 1. Re: help with car racing ..better explained
          Level 7
          ac online wrote:
          > ive been making a car racing type game, and ive managed designing the levels,
          > made character, added if (Key.isDown(Key. -x-)
          > statmentsd to move down and up and ive added rotation for left and right?
          > it all works perfect ( no syntax errors)
          > but when using up and down keys it uses the default north and south.. i want
          > to know how to get it going forward and back but the way the car is actually
          > facing?.. i need to make the car move ( up/down/rightrotate/left rotate) the
          > way he is looking at that moment... how do i set where the front and the back
          > is... plz help

          Start with the car facing right, this is 0 degrees in flash. Now, when
          the right or left arrow are pressed and you get the car to rotate you
          need to keep track of what angle it is facing.

          Or, if you want to use a standard unit circle for your angles, then look
          into the code you can find here:
          http://www.senocular.com/flash/source.php?id=0.114

          Now, once you have the angle and you determine the speed your car moves,
          you can just figure out the trig to make it drive along the line it is
          pointing.