I know I'll be asked to give context so I'll do so. I'm editing an .swf Mario game. I'm replacing the Mario fireball with a hammer but for some reason it only shoots right. Here is the code for the if statement (when you hit the space bar)
if(Key_off == 0 && crouch == 0 && slide == 0)
{
if(_root.Fireball < 2)
{
_loc3_ = _root.level.getNextHighestDepth();
var _loc3_ = _root.level.attachMovie("hammer","Enemy" + _loc3_,_loc3_);
_loc3_._y = _Y;
_loc3_._x = _X + (lr >= 0?17:-7);
_loc3_.dir = lr * 3;
_loc3_.vit = -19;
_loc3_.lr = -1;
_root.throw_hammerfx.start(0,0);
Key_off = 1;
}
}
Note: I don't know a lot of these variables as I did not design this. Don't ask me what they mean. (although I've noticed that the height the hammer is thrown at is affected by how low 'vit' is)
So I plan to change the 'root.fireball' if statement to also check if the image of Mario facing right is shown. and make an elif statement to test for mario facing right. For mario facing left, the data will be multiplied by -1. Failing that I think the hammer's motion is decided in its own actionscript. So I'll test for mario's image their instead.
Add a variable to player pressing left. Make it = 1 and for mario facing right make it =2. Check for what that variable = in your if mario presses 32.