# Jumping problems

**URL:** https://forum.kirupa.com/t/jumping-problems/190635
**Category:** programming
**Created:** [June 13, 2006, 5:09pm UTC](https://forum.kirupa.com/t/jumping-problems/190635 "2006-06-13T17:09:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zendo49](https://avatars.discourse-cdn.com/v4/letter/z/ce7236/32.png) [@zendo49](https://forum.kirupa.com/u/zendo49)
#### Post date: [June 13, 2006, 5:09pm UTC](https://forum.kirupa.com/t/jumping-problems/190635/1 "2006-06-13T17:09:46Z")

</div>

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.

```php

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.

```php

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
