1 Reply Latest reply on Nov 25, 2010 2:56 PM by gaminflash

    Bullet is not starting from the car

    antworker

      Hello!
      I'm creating a small car game where you shoot from the car, so I've made a bullet animation with this code inside the mocieclip:

       

      shellNo = 0;
      function shellEject(){
      shell_holder.attachMovie("shellAnim", shellNo, shellNo);
      shellNo++;
      }

       

      But the problem is that the car is moving when you controll it so the bullet stays on the same position and I want it to follow the car and start from the side of it whereever it goes.

       

      So that's my problem.
      Thank you!

        • 1. Re: Bullet is not starting from the car
          gaminflash

          Thats because you haven't set where you want the bullets to start from. Try this instead:

           

          shellNo = 0;
          function shellEject(){
          var createshell = shell_holder.attachMovie("shellAnim", shellNo, shellNo, _root.getNextHighestDepth(), _root.getNextHighestDepth());
          shellNo++;

          createshell._y = _root.car_y

          createshell._x = _root.car_x
          }