onClipEvent (load) {
moveSpeed = 10;
jumping = true;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
walking = true;
this._x += moveSpeed;
this._xscale = +100;
} else if (Key.isDown(Key.UP)) {
this._y -= 0;
} else if (Key.isDown(Key.DOWN) && !fall) {
this._y += 0;
} else if (Key.isDown(Key.LEFT)) {
walking = true;
this._x -= moveSpeed;
this._xscale = -100;
if (walking == true) {
this.gotoAndPlay("walk");
}
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y = 36;
jumping = true;
walking = false;
}
if (jumping == true) {
this.gotoAndStop("jump");
vel_y -= 2;
if (vel_y<=-15) {
vel_y = -15;
}
this._y -= vel_y;
}
if (_root.ground.hitTest(this._x, this._y+35, true)) {
vel_y = 0;
jumping = false;
walking = false;
this.gotoAndStop("idle");
}
}
onClipEvent (enterFrame) {
this._y += 16;
if (_root.ground.hitTest(this._x, this._y+1, true)) {
this._y -= 16;
}
}
i can’t figure out how to make the walking animation work
any ideas?