Implemented the factory method for Projectiles.
Note: beware of bugs in the above code: I have only proved it correct, not tried it