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:
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
Fla: www.crucialclan.1go.dk/game.fla