hey guys
i am having trouble with a jumping code
it works fine but the problem is the gravity.
in my character i use fall for gravity.
if (!_root.ground.hitTest(this._x, this._y+15, true) && !jumping) {
fall += 1;
move = false;
this.gotoAndStop("jump");
if (fall>19) {
fall = 19;
}
this._y += fall;
}
that is what i use for gravity.
but now for the ladder this is the simple code i wrote and its not working correctly can u take a look and help me with it thanks so much
heres the code i used.
onClipEvent(load) {
climbladder = false;
}
onClipEvent(enterframe) {
if(_root.ladder.hitTest(this._x, this._y+90, true) {
climbladder = true;
} if(climbladder == true && Key.isDown(Key.UP)) {
fall = 0;
this.gotoAndStop("climbing");
this._y -= 5;
}
}
now i just wrote this on here so if there is simple errors thats fine cause on the fla file there is no errors that is just the basic of my climb ladder code. but what happens when i press up on the ladder it goes to the climbing frame in the hero but it falls i am assuming its cause of the gravity but i have set gravity to 0 when hero touches ladder.
thanks guys hope you can help
zendo