3 Replies Latest reply on Sep 27, 2012 2:53 PM by Ned Murphy

    Moving up, down, left, right with scale changing

    LukeElChul Level 1

      Ive made this code but i cant get it to work right, you move left and right and up and down but when moving up and down increase/Decrease scale.

       

      The scale stays the same and gliches alot.

       

      onClipEvent(load){

                var Scale = 80;

                var MinScale = -80;

      }

       

       

      onClipEvent(enterFrame){

                if(Key.isDown(Key.LEFT)){

                          this._x -= _root.Speed;

                          this._xscale = this.MinScale;

                          this.gotoAndStop(2);

      }else if(Key.isDown(Key.RIGHT)){

                          this._x +=  _root.Speed;

                          this._xscale = this.Scale;

                          this.gotoAndStop(2);

      }else if(Key.isDown(Key.UP)){

                                    this._y -=  _root.Speed;

                                    this.gotoAndStop(2);

                                    if(this._height <= 50){

                                              this._height = 50;

                                    }else if(this._height <= 80){

                                              this._height -= 0.5;

                                              this._width -= 0.3;

                                              this.Scale -= 0.3;

                                              this.MinScale += 0.3;

                                    }

                }else if(Key.isDown(Key.DOWN)){

                                              this._y +=  _root.Speed;

                                              this.gotoAndStop(2);

                    if(this._height >= 50){

                                              this._height += 0.5;

                                              this._width += 0.3;

                                              this.Scale += 0.3;

                                              this.MinScale -= 0.3;

                                    }else if(this._height >= 80){

                                              this._height = 80;

       

                                    }

                                    }else{

                                              this.gotoAndStop(1);

                                    }

      }

       

      Thanks for the help