# Platform Help!

**URL:** https://forum.kirupa.com/t/platform-help/165400
**Category:** Uncategorized
**Created:** [October 10, 2005, 9:14pm UTC](https://forum.kirupa.com/t/platform-help/165400 "2005-10-10T21:14:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![esnetni](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@esnetni](https://forum.kirupa.com/u/esnetni)
#### Post date: [October 10, 2005, 9:14pm UTC](https://forum.kirupa.com/t/platform-help/165400/1 "2005-10-10T21:14:28Z")

</div>

ok im working on a mario game ok and i used this code for mario  
onClipEvent (load) {  
jumpCount = 0;  
jumpSpeed = 11;  
jumpMaxHeight = 10;  
fallspeed = 6;  
runspeed = 5;  
}  
onClipEvent (enterFrame) {  
stop();  
if (Key.isDown(Key.DOWN)) {  
speed = 0;  
moving = false;  
movingb = false;  
this.gotoAndStop(“duck”);  
} else if (Key.isDown(Key.CONTROL)) {  
speed = 0;  
moving = false;  
movingb = false;  
this.gotoAndStop(“attack”);  
} else if (Key.isDown(Key.LEFT)) {  
speed = -runspeed;  
movingb = true;  
\_root.maps.\_x -= speed;  
this.\_xscale = -100;  
this.gotoAndStop(“run”);  
moving = true;  
} else if (Key.isDown(Key.RIGHT)) {  
speed = runspeed;  
movingb = true;  
\_root.maps.\_x -= speed;  
moving = true;  
this.\_xscale = 100;  
this.gotoAndStop(“run”);  
} else {  
movingb = true;  
speed = 0;  
moving = false;  
this.gotoAndStop(“idle”);  
}  
if (Key.isDown(Key.SPACE) && (\_root.maps.ground.hitTest(this.\_x, this.\_y, true) && movingb)) {  
jumping = true;  
}  
if (Key.isDown(Key.SPACE)) {  
jumpSpeed -= .75;  
} else if (!Key.isDown(Key.SPACE)) {  
jumping = false;  
}  
if (jumpCount\<=jumpMaxHeight && jumping) {  
jumpCount++;  
\_root.maps.\_y += jumpSpeed;  
} else if (jumpCount\>jumpMaxHeight && jumping && jumpSpeed\<1) {  
\_root.maps.\_y -= fallspeed;  
}  
if (!\_root.maps.ground.hitTest(this.\_x, this.\_y, true) && !jumping) {  
\_root.maps.\_y -= fallspeed;  
}  
if (\_root.maps.ground.hitTest(this.\_x, this.\_y, true)) {  
jumpCount = 0;  
jumpSpeed = 11;  
}  
}

i want mario to have a action when jumps where how do i change the code to make that like when he jumps how he looks is different
