Using the factory pattern to create entities (players and weapons)