Skip to content

Commit

Permalink
Support pause/resume in whackamole
Browse files Browse the repository at this point in the history
gweedo767 committed Mar 24, 2016
1 parent fd96321 commit eca17cb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Corsair Whack A Mole/WhackAMoleGame.cs
Original file line number Diff line number Diff line change
@@ -63,6 +63,26 @@ public override void RestoreState()
{
base.RestoreState();
Console.WriteLine("WhackAMoleGame RestoreState() called");

//put all the keys back in to play
for (int row = 0; row < 3; row++)
{
for (int col = 0; col < 10; col++)
{
GameMapKeyGroup.AddKey(GameMap[row, col]);
}
}

//restore the moles!
for (int i = 0; i < Moles.Count; i++)
{
Mole mole = Moles[i];
MolesKeyGroup.AddKey(mole.Key);
GameMapKeyGroup.RemoveKey(mole.Key);
}

running = 1; //start the game back up
GameLoop();
}

public void Initialize()

0 comments on commit eca17cb

Please sign in to comment.