PDA

View Full Version : Jumping problems



zendo49
June 13th, 2006, 02:09 PM
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

nathan99
June 14th, 2006, 03:21 AM
we're going toneed a FLA, or your actual code, because you only have 28 posts we arent exactly sure how good you are and which might just be cause you typed in this... or at least an swf

zendo49
June 14th, 2006, 12:05 PM
ok i will post a SWF file if you need and FLA just tell me.
http://jabbatown.com/mario/mario-2.swf
The reall problem if you go threw the game climbing the ladder i want the charater to stick.
also you think you can give me your opinion.
thanks
-zendo