# Side Scroller Help Desperately Needed!

**URL:** https://forum.kirupa.com/t/side-scroller-help-desperately-needed/47025
**Category:** Uncategorized
**Created:** [March 30, 2004, 9:39am UTC](https://forum.kirupa.com/t/side-scroller-help-desperately-needed/47025 "2004-03-30T09:39:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![madbadrab](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@madbadrab](https://forum.kirupa.com/u/madbadrab)
#### Post date: [March 30, 2004, 9:39am UTC](https://forum.kirupa.com/t/side-scroller-help-desperately-needed/47025/1 "2004-03-30T09:39:50Z")

</div>

Hi.  
I’m making a side scroller game in flash mx 2004. my character is a movieclip containing movieclips of walking, standing and  
jumping animations. I can make him walk left and right okay but when it comes to jumping i have this code:

onClipEvent (load) {  
grav\_y = 0;  
jumping = false;  
}  
onClipEvent (enterFrame) {

```
if (Key.isDown(Key.SPACE) && !jumping) {
	grav_y = 15;
	jumping = true;
}
if (jumping == true) {
	grav_y -= 1;
	if (grav_y&lt;=-7.5) {
		grav_y = -7.5;
	}
	this._y -= grav_y;
}
if (_root.ground.hitTest(this._x, this._y+45, true)) {
	grav_y = 0;
	jumping = false;
}

```

}

This works fine except that the character jumps while in the standing animation. where do i insert the gotoAndStop(“jump”); ??

Also i used the if(Key.isDown) function for when the character attacks but the animation only plays while the key is held down. how can i make it so he attacks when a key is tapped?

Thanx in advance
