# What's a good way to programmatically manage a cloneable entity?

Say you have missiles or rockets that a player can fire.

What's a good way to programmatically manage the cloning of a base rocket, for example?

I can think of 2 ways to do it:

• Player has a currently selected weapon (which is an int)
• When player shoots, the selectedWeapon member is looked at, and the correct instance of rocket is created (with some base parameters)

Or

• Player has a currently selected weapon (which is a pointer, to a "base instance" of the rocket object)
• When player shoots, the base instance rocket is cloned, transformed, and shot into the game world
• A clone is an exact copy. You don't want that ( transformation, state etc ). Perhaps it's a case of semantics. But you're question should just be about instantiating. – Sidar Nov 21 '12 at 18:08