# Maximum jump height for platformer

**URL:** <https://forum.kirupa.com/t/maximum-jump-height-for-platformer/265222>\
**Category:** Uncategorized\
**Created:** [July 6, 2008, 4:36pm UTC](https://forum.kirupa.com/t/maximum-jump-height-for-platformer/265222 "2008-07-06T16:36:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matti9](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@matti9](https://forum.kirupa.com/u/matti9)\
**Post date:** [July 6, 2008, 4:36pm UTC](https://forum.kirupa.com/t/maximum-jump-height-for-platformer/265222/1 "2008-07-06T16:36:07Z")

</div>

I am making my second game, and it’s going to be a platformer. :2c: Unfortunately, I have no idea how to make the character (named hero) jump only to a certain height, and then fall back down. someone, please post a way to do this!

---

<div class="post-metadata">

**Author:** ![gigaboost](https://avatars.discourse-cdn.com/v4/letter/g/58956e/32.png) [@gigaboost](https://forum.kirupa.com/u/gigaboost)\
**Post date:** [July 6, 2008, 7:44pm UTC](https://forum.kirupa.com/t/maximum-jump-height-for-platformer/265222/2 "2008-07-06T19:44:44Z")

</div>

Have a set variable for gravity, and one for falling speed, add the gravity to the falling speed, and add negative falling speed when you want to jump.

> 

gravity = 1;  
fallSpeed = 0;  
jumpHeight = 10;

then, add the gravity to the fallspeed and add the fallspeed to the \_y position of the movieclip.

> 

fallSpeed += gravity;  
\_y -= fallSpeed

on the jumping action,

> 

\_y+=jumpHeight;

And it will look very smooth and good.
