This is like, you're third thread for the
exact same script.
You need to use this for your angle:
PHP Code:
temp.angle = (pi / 2) * (player.dir + 1);
Look carefully at your code, then look up something called "order of operations"; it will explain why "your" angle didn't work, though it is nearly the same.