# Super Mario Sunshine - Stuck on ground!

**URL:** <https://forum.kirupa.com/t/super-mario-sunshine-stuck-on-ground/77206>\
**Category:** programming\
**Created:** [January 25, 2005, 2:39pm UTC](https://forum.kirupa.com/t/super-mario-sunshine-stuck-on-ground/77206 "2005-01-25T14:39:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RyxiaN](https://avatars.discourse-cdn.com/v4/letter/r/53a042/32.png) [@RyxiaN](https://forum.kirupa.com/u/RyxiaN)\
**Post date:** [January 25, 2005, 2:39pm UTC](https://forum.kirupa.com/t/super-mario-sunshine-stuck-on-ground/77206/1 "2005-01-25T14:39:54Z")

</div>

I am going to make a Mario Sunshine game. But I need help. You cannot pump when you are on the ground. I know why but I dont know how to fix it? Source are down in the post. Code is:

```php
onClipEvent(load){
 moveSpeed = 2;
 vel_y = 0;
 dead = false;
 Kright = Key.RIGHT;
 Kleft = Key.LEFT;
 Kup = Key.UP;
 Kdown = Key.DOWN;
 this.stop();
}
onClipEvent(keyUp){
 gotoAndStop("idle");
}
onClipEvent(enterFrame){
 _y-= vel_y;
 vel_y = vel_y - 0.5;
 if (Key.isDown(Kleft)){
  _x-= moveSpeed;
  this.gotoAndStop("walk");
  _xscale = -100;
 } else if (Key.isDown(Kright)){
  _x+= moveSpeed;
  this.gotoAndStop("walk");
  _xscale = 100;
 }
 if (Key.isDown(("A").charCodeAt(0))){
  vel_y = vel_y + 0.7;
  this.gotoAndStop("pump");
 }
 if (_root.ground.hitTest(this)){
  vel_y = 0;
 }
}

```

**Swf:** [www.crucialclan.1go.dk](http://www.crucialclan.1go.dk)  
**Fla:** [www.crucialclan.1go.dk/game.fla](http://www.crucialclan.1go.dk/game.fla)
