Exemple #1
0
        public static void NewGame()
        {
            _transitioning = false;
            _solveCount    = 0;
            SolveIcons.Initialize(Statics.WinCount);

            CurrentPuzzles.Clear();
            List <int> currentPuzzles = new List <int>();

            for (int i = 0; i < Statics.WinCount; i++)
            {
                int index = Statics.r.Next(AllPuzzles.Count);
                while (_lastUsed.Contains(index) || currentPuzzles.Contains(index))
                {
                    index = Statics.r.Next(AllPuzzles.Count);
                }

                if (_lastUsed.Count >= (AllPuzzles.Count / 2))
                {
                    _lastUsed.RemoveAt(0);
                }
                _lastUsed.Add(index);

                AllPuzzles[index].Refresh();
                CurrentPuzzles.Add(AllPuzzles[index]);
                currentPuzzles.Add(index);
            }
        }
 public override void Draw(CanvasAnimatedDrawEventArgs args)
 {
     BackgroundWords.Draw(args);
     if (str != null)
     {
         str.DrawMirrored(args);
     }
     SolveIcons.Draw(args);
 }
        public override void Update(CanvasAnimatedUpdateEventArgs args)
        {
            if (BackgroundWords.Count < 50)
            {
                BackgroundWords.EnqueueWinningWords(50);
            }

            BackgroundWords.Update(args);
            if (str != null)
            {
                str.Update(args);
            }
            PuzzleCollection.Update(args);
            SolveIcons.Update(args);
        }
Exemple #4
0
        public static void SolveCurrentPuzzle()
        {
            if (CurrentPuzzle == null)
            {
                return;
            }

            if (!_transitioning)
            {
                _transitioning = true;
                CurrentPuzzle.Solve();
                SolveIcons.FadeIn(_solveCount);
                _solveCount++;

                Music.Play(Music.Whoosh);
            }
        }
 public override void Update(CanvasAnimatedUpdateEventArgs args)
 {
     PuzzleCollection.Update(args);
     BackgroundWords.Update(args);
     SolveIcons.Update(args);
 }
 public override void Draw(CanvasAnimatedDrawEventArgs args)
 {
     PuzzleCollection.Draw(args);
     BackgroundWords.Draw(args);
     SolveIcons.Draw(args);
 }