// Constructor public MainPage() { InitializeComponent(); playMode = PlayMode.OnlineImage; playTime = 0; UpdateTime(); timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += timer_Tick; timer.Stop(); rand = new Random(); isGameStarted = false; squares = new List<Square>(); images = new List<Image>(); InitializeSquares(); puzzleBoard = new PuzzleBoard(squares); SetImageBackgrounds(); }
// ************************************************************************** private void ResetPuzzle() { foreach (Image im in images) { MainGrid.Children.Remove(im); } images = new List<Image>(); squares = new List<Square>(); puzzleBoard = new PuzzleBoard(squares); playTime = 0; UpdateTime(); InitializeSquares(); }