If I want to create a smart contract with an action 'Create Game' and on calling that action a new contract be formed, how is it possible?
2 Answers
You can't create a 'new' contract, but you can call another contract's function and create a new object in that contract to save the state.
You can refer to eosio.token inline functions get_balance/get_supply where both functions are accessible from any other contracts by just initializing eosio.token in your own contract.
edit: It is not possible to create an object in another contract as it will consume ram
Think of your contract as a factory. You keep a collection of games. Each game is an instance of a struct called game - it has all the state fields of a game. When someone creates a new game you just add one to the collection.
setcode
is in the available contract API so I don't think it's possible directly