8 Replies Latest reply on Jul 21, 2006 1:53 PM by DarkVortex

    Shooting

    DarkVortex
      im making a space invaders type game and i need help with the shooting.im using the mouse to move and im making the spacebar to shoot but what kkeps happening is if you press space it shoots. but if you press it again before the tween ends it shoots again. i was going to do variables but i dont know how. here is my code so far:

      onClipEvent (load) {
      _x = 0;
      speed = 5;
      }
      onClipEvent (enterFrame) {
      endX = _root._xmouse;
      _x += (endX-_x)/speed;
      }
      on (keyPress"<space>") {
      gotoAndPlay(2);
      }