How to change shooting directions?

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 :).

Don’t know if its a type0 but…


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 :smiley: [size=1] but then i don’t have flash here at school[/size]

:wink:

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