# How to change shooting directions?

**URL:** <https://forum.kirupa.com/t/how-to-change-shooting-directions/42559>\
**Category:** Uncategorized\
**Created:** [February 10, 2004, 12:20pm UTC](https://forum.kirupa.com/t/how-to-change-shooting-directions/42559 "2004-02-10T12:20:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fargate](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@Fargate](https://forum.kirupa.com/u/Fargate)\
**Post date:** [February 10, 2004, 12:20pm UTC](https://forum.kirupa.com/t/how-to-change-shooting-directions/42559/1 "2004-02-10T12:20:46Z")

</div>

I have the following player control script

[AS]  
onClipEvent (enterFrame) {  
if (Key.isDown(Key.RIGHT)) {  
this.\_x += 5;  
this.play();  
this.\_xscale = 100  
} else if (Key.isDown(Key.LEFT)) {  
this.\_x -= 5;  
this.play();  
this.\_xscale = -100  
}  
}  
[/AS]

My Guy normally shoots to the right, so the problem is when he turns to the left it looks like he’s shooting out of his back. How can I make it so that when he turns to the left he shoots in that direction as well.

I already tried the below altered shooting script…no success

[AS]  
onClipEvent (load) {  
if(\_root.mario.\_xscale =100) {   
shellMoveSpeed = 10;  
this.\_x = \_root.mario.\_x+10;  
this.\_y = \_root.mario.\_y;  
} else if (\_root.mario.\_xscale = -100) {   
shellMoveSpeed = - 10;  
this.\_x = \_root.mario.\_x-10;  
this.\_y = \_root.mario.\_y;  
}  
}  
[/AS]

Dunno…any ideas on how to fix this???Thanks in advance :).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 10, 2004, 1:02pm UTC](https://forum.kirupa.com/t/how-to-change-shooting-directions/42559/2 "2004-02-10T13:02:03Z")

</div>

Don’t know if its a type0 but…

```auto

onClipEvent (load) {
        if(_root.mario._xscale **==** 100) {
                shellMoveSpeed = 10;
                this._x = _root.mario._x+10;
                this._y = _root.mario._y;
        } else if (_root.mario._xscale **==** -100) {
                shellMoveSpeed = - 10;
                this._x = _root.mario._x-10;
                this._y = _root.mario._y;
        }
}

```

== tests a variable  
= asigns a veriable

the rest looks fine to me 😃 [size=1] but then i don’t have flash here at school[/size]

😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 10, 2004, 8:42pm UTC](https://forum.kirupa.com/t/how-to-change-shooting-directions/42559/3 "2004-02-10T20:42:57Z")

</div>

Yeah it works! Thanks a lot :D!!!
