00:00
00:00
View Profile taco857

Age 29, Male

Earth I think

Joined on 12/19/07

Level:
5
Exp Points:
220 / 280
Exp Rank:
> 100,000
Vote Power:
4.28 votes
Rank:
Civilian
Global Rank:
> 100,000
Blams:
4
Saves:
11
B/P Bonus:
0%
Whistle:
Normal
Medals:
8

action script

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


Comments

Comments ain't a thing here.