# Platform jumping

**URL:** <https://forum.kirupa.com/t/platform-jumping/207259>\
**Category:** Uncategorized\
**Created:** [November 16, 2006, 1:11am UTC](https://forum.kirupa.com/t/platform-jumping/207259 "2006-11-16T01:11:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![qzp](https://avatars.discourse-cdn.com/v4/letter/q/a87d85/32.png) [@qzp](https://forum.kirupa.com/u/qzp)\
**Post date:** [November 16, 2006, 1:11am UTC](https://forum.kirupa.com/t/platform-jumping/207259/1 "2006-11-16T01:11:17Z")

</div>

when i try to make the character jump when he is on the platform it doesnt work.  
heres my actionscript

> 

onClipEvent(load) {  
speed=7;  
jumping=false;  
jump=0;  
startY=\_y;  
scrollspeed=7;  
fallspeed=5;  
}  
onClipEvent(enterFrame) {  
if (jumping) {  
\_y += jump;  
jump += 1;  
if (\_y\>=startY) {  
\_y = startY;  
jumping = false;  
}  
}  
else {  
if (Key.isDown(Key.SPACE)) {  
jumping = true;  
jump = -15;  
speed=7;  
}  
}  
if(Key.isDown(Key.LEFT)) {  
\_x -= speed;  
\_root.ground.\_x+=scrollspeed;  
}  
if(Key.isDown(Key.RIGHT)) {  
\_x += speed;  
\_root.ground.\_x-=scrollspeed;  
}  
if(\_root.ground.hitTest(this.\_x, this.\_y, true)) {  
jump=12;  
jumping=false;  
}  
else {

}  
}
