Here
Age 30, Male
Earth I think
Joined on 12/19/07
Posted by taco857 - April 5th, 2008
Here an action script code for jumping and walking
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !jumping) {
vel_y = 36;
jumping = true;
}
if (jumping == true) {
vel_y -= 2;
if (vel_y<=-15) {
vel_y = -15;
}
this._y -= vel_y;
}
if (_root.ground.hitTest(this._x, this._y+27, true)) {
vel_y = 0;
jumping = false;
}
}
onClipEvent (enterFrame) {
this._y += 16;
if (_root.ground.hitTest(this._x, this._y+27, true)) {
this._y -= 16;
}
}
onClipEvent (enterFrame) {
if (!Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) {
this.gotoAndStop(1);
}
if (Key.isDown(Key.LEFT)) {
this.play();
this._x -= 15;
this._xscale = 100;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this.play();
this._x += 15;
this._xscale = -100;
}
}
then make an mc and lable it ground
lable you guy character
make sure your guy is facing right