# Platform game, jumping

**URL:** <https://forum.kirupa.com/t/platform-game-jumping/188294>\
**Category:** Uncategorized\
**Created:** [May 6, 2006, 2:05am UTC](https://forum.kirupa.com/t/platform-game-jumping/188294 "2006-05-06T02:05:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhryn](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@Dhryn](https://forum.kirupa.com/u/Dhryn)\
**Post date:** [May 6, 2006, 2:05am UTC](https://forum.kirupa.com/t/platform-game-jumping/188294/1 "2006-05-06T02:05:32Z")

</div>

I am trying to write a platform game and have followed the tutorial on this site, however I want to write it myself, or most of it anyway.

I am having trouble with the jumping, I dont really understand the jumping method in the tutorial.

I have tried a simple code but it looks really bad, I wanted something that will decrease in size and then start to fall, I have no idea how to do this.

my code so far is:

```auto
onClipEvent(load){
    speed = 10;
    grav = 9;
    jumping = false;
    falling = true;
}
onClipEvent(enterFrame){
    if (falling){
        _root.ground._y-= grav;
    }
    if(Key.isDown(Key.RIGHT)){
        _root.ground._x -= speed;
    }
    if(Key.isDown(Key.LEFT)){
        _root.ground._x += speed;
    }
    if(_root.ground.hitTest(this._x, this._y, true)){
        falling = false;
    }
    if(Key.isDown(Key.UP) && !jumping){
        jumping = true;
    }
    if(jumping){
        _root.ground._y+= jump;
    }
}

```

any help would be great
