xna - When changing state can I re-initialize my code? -


so i've got game runs 4 game states. 1 main menu , 3 mini-games. within each of these mini games there smaller states handle various sections of gameplay.

now here's question. when player dies in game want restart game them @ beginning. use 1 of mini game structs send them .beginning lot of bools , counters messed because different initialize have them set to.

is there way can send player .beginning , tell code reinialize in order values should start of game?

cheers folks

it depends on architecture of game , code in overall.
if use different classes game states (for example, 1 menu class per game state), create method set bools , counters default values. or recreate menu if doesn't contain important data.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -