# Jumping problem getting closer to solved!

**URL:** https://forum.kirupa.com/t/jumping-problem-getting-closer-to-solved/60016
**Category:** programming
**Created:** [August 5, 2004, 5:54pm UTC](https://forum.kirupa.com/t/jumping-problem-getting-closer-to-solved/60016 "2004-08-05T17:54:39Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![elPooter](https://avatars.discourse-cdn.com/v4/letter/e/839c29/32.png) [@elPooter](https://forum.kirupa.com/u/elPooter)
#### Post date: [August 5, 2004, 5:54pm UTC](https://forum.kirupa.com/t/jumping-problem-getting-closer-to-solved/60016/1 "2004-08-05T17:54:39Z")

</div>

Ok, I finally am coming to a close with my jumping problems!:party: I have only a few problems in the process though. when he jumps, he gos up, right? well, if he lands on a higher platform, he bumps on it, then falls through it :huh:! my code is the following:

```php
 
onClipEvent (load) {
jumping = 0;
gravity = 9.8;
startspeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) and jumping == 0) {
this.gotoAndStop("jump");
jumping = 1;
starttime = getTimer()/1000;
startpos = _y;
}
if (jumping == 1) {
time = getTimer()/1000-starttime;
_y = _y-(startspeed-gravity*time);
if (_y>startpos) {
_y = startpos;
jumping = 0;
}
if (_root.walls.hitTest(getBounds(_root).xMax, _y, true)) {
this._x -= 2;
}
if (_root.walls.hitTest(getBounds(_root).xMin, _y, true)) {
this._x += 2;
}
if (_root.walls.hitTest(_x, getBounds(_root).yMin, true)) {
this._y += 5;
}
if (_root.walls.hitTest(_x, getBounds(_root).yMax, true)) {
this._y -= 9.8;
}
}
}

```

I have NO clue whats wrong, and I am So close to finishing my jumping problem! Please help!

-elPooter.
