Fixed the weird projectile directions sometimes.
Improved some code to be clearer and added parameters.
Placed comments in all my code.