# Game: Attacking Left and Right

**URL:** <https://forum.kirupa.com/t/game-attacking-left-and-right/119558>\
**Category:** Uncategorized\
**Created:** [August 16, 2004, 12:26pm UTC](https://forum.kirupa.com/t/game-attacking-left-and-right/119558 "2004-08-16T12:26:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_blue](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@Mr\_blue](https://forum.kirupa.com/u/Mr_blue)\
**Post date:** [August 16, 2004, 12:26pm UTC](https://forum.kirupa.com/t/game-attacking-left-and-right/119558/1 "2004-08-16T12:26:10Z")

</div>

well this is my 1-st try at makeing a game, and so far its going as i want it to.

but now i have a problem, i want my MC (Man) to be able to atack in 2 directions (Left and Right) depending on the \_xscale (or something else), and i need help for the code.

here is what i have:

MC: Man  
MC: Star (the thing that has to fly the way my MC (Man) is facing)

Plz help me in any way you can.

---

<div class="post-metadata">

**Author:** ![OnionSkin](https://avatars.discourse-cdn.com/v4/letter/o/0ea827/32.png) [@OnionSkin](https://forum.kirupa.com/u/OnionSkin)\
**Post date:** [August 16, 2004, 1:31pm UTC](https://forum.kirupa.com/t/game-attacking-left-and-right/119558/2 "2004-08-16T13:31:47Z")

</div>

Look down a few posts. **“Attacking in Multiple Directions”**. It worked great for me.

---

<div class="post-metadata">

**Author:** ![Mr\_blue](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@Mr\_blue](https://forum.kirupa.com/u/Mr_blue)\
**Post date:** [August 16, 2004, 2:33pm UTC](https://forum.kirupa.com/t/game-attacking-left-and-right/119558/3 "2004-08-16T14:33:23Z")

</div>

allready did that before i posted, but no luck.

---

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [August 16, 2004, 3:40pm UTC](https://forum.kirupa.com/t/game-attacking-left-and-right/119558/4 "2004-08-16T15:40:26Z")

</div>

well i dont know wot ur variables are but i will guess from wot u have.

```auto

 onClipEvent (load) {
 	speed = 5;
 	ducking = false;
 	scale = 100;
 }
 onClipEvent (enterFrame) {
 	if (Key.isDown(Key.LEFT) && ducking == false) {
 		_x -= speed;
 		this.gotoAndStop(2);
 		_xscale = -scale;
 	} else if (Key.isDown(Key.RIGHT) && ducking == false) {
 		_x += speed;
 		this.gotoAndStop(2);
 		_xscale = scale;
 	} else if (Key.isDown(Key.DOWN)) {
 		this.gotoAndStop(4);
 		ducking = true;
 	} else {
 		this.gotoAndStop(1);
 		ducking = false;
 	}
 }
 
 

```

i attached an FLA to if u want it.

---

<div class="post-metadata">

**Author:** ![Mr\_blue](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@Mr\_blue](https://forum.kirupa.com/u/Mr_blue)\
**Post date:** [August 16, 2004, 4:06pm UTC](https://forum.kirupa.com/t/game-attacking-left-and-right/119558/5 "2004-08-16T16:06:14Z")

</div>

nope thats not what i am looking for, i got the walking down and every thing its “Attacking Left and Right” i cant get to work.

Sorry just saw you can attach files, so if you want to have a look plz do.

---

<div class="post-metadata">

**Author:** ![Mr\_blue](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@Mr\_blue](https://forum.kirupa.com/u/Mr_blue)\
**Post date:** [August 17, 2004, 7:04am UTC](https://forum.kirupa.com/t/game-attacking-left-and-right/119558/6 "2004-08-17T07:04:05Z")

</div>

well never mind, i just got it working (-:

---

<div class="post-metadata">

**Author:** ![Mr\_blue](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@Mr\_blue](https://forum.kirupa.com/u/Mr_blue)\
**Post date:** [August 18, 2004, 11:52am UTC](https://forum.kirupa.com/t/game-attacking-left-and-right/119558/7 "2004-08-18T11:52:19Z")

</div>

Well same Game New problem.

the problem is when i jump up on the platform going upwards and walking on it, instead of my MC(Man) going up he just goes through the platform, what am i doing rong? help plz
