order to put the anims. in:
standing
run right
run left
attack
jumping
put this in the main mc(replace GREATERTHAN with yhe actual sign cuz they dont let u put it in the description):
onClipEvent (load) {
speed = 20;
}
onClipEvent(enterFrame) {
if (!touchingGround) {
grav++;
this._y += grav;
} else {
grav = 0;
}
if (_root.ground.hitTest(_x,_y,true)) {
touchingGround = true;
} else {
touchingGround = false;
}
}
onClipEvent (enterFrame) {
if ((Key.isDown(Key.RIGHT)) && (jumping == false)) {
this.gotoAndStop(2);
}
if ((Key.isDown(Key.LEFT))&& (jumping == false)) {
this.gotoAndStop(3);
}
if (Key.isDown(Key.RIGHT)) {
this._x += speed;
}
if (Key.isDown(Key.LEFT)) {
this._x -= speed;
}
if (Key.isDown(65)) {
this.gotoAndStop(4);
}
}
onClipEvent(enterFrame) {
if (jumped) {
falling += 0.5;
_y += falling;
}
}
onClipEvent (load) {
y_start = _y;
jumping = false;
jumpspeed = 0;
}
onClipEvent (enterFrame) {
if (jumping) {
_y += jumpspeed;
jumpspeed += 1;
if (_yGREATERTHAN=y_start) {
_y = y_start;
jumping = false;
}
} else {
if (Key.isDown(Key.SPACE)) {
jumping = true;
jumpspeed = -14;
this.gotoAndStop(5);
}
}
if (_root.ground.hitTest(this._x, this._y, true) && falling) {
// if hitting X an Y postions with the ground and falling
jump = 12;
// jump is set to 9
jumping = false;
// jumping is false
falling = false;
// falling is false
}
}
put this in the last frame of each animation except for standing:
_root.ryu.gotoAndStop(1);
put this on of the frames inside of the main mc:
stop();
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 45: Clip events are permitted only for movie clip instances onClipEvent (enterFrame) {
BunkeyTheMunkey1 11 months ago
@BunkeyTheMunkey1 first, you put the code in the wrong place; use this UPDATED tutorial:
/watch?v=ZrqpRcfaPN0
itzmrrip 11 months ago
SLOW TYPING...
brm117 1 year ago
@brm117 Great.Thats nice to know.
itzmrrip 1 year ago
dude what do you mean by replace GREATERTHAN with yhe actual sign
please explain to me more
mechsbattles 1 year ago
@mechsbattles in the code there is a giant 'GREATERTHAN'. replace it with >
itzmrrip 1 year ago