1 Reply Latest reply on Feb 21, 2008 1:42 PM by Rothrock

    help with my true/false statments

    spyboy1o1
      [CODE]onClipEvent(load){
      speed=3;
      gravity=-1;
      base = true;
      }
      onClipEvent(enterFrame){
      if (Key.isDown(Key.UP)){
      this._y-=speed;
      base = false;
      }
      if (this.hitTest(_root["base"])){
      base = true;
      }
      if (Key.isDown(Key.UP)){
      this._y-=speed;
      base = false;
      }
      if(base = true){
      this._y-=gravity;
      }
      }[/CODE]

      trying to make a game, where you start on a base "base" then you fly your ship up with the arrow key up, and when you leave go of the key, you get pulled down by my gravity... but the only way gravity works if if i put

      [CODE]if(base = true){
      this._y-=gravity;
      }[/CODE]
      but then gravity always works expect when i got up, down.
      if i set it to false, it never works