void ShowSequenceAnimation(int level)
        {
            if (isAnimating)
            {
                return;
            }
            isAnimating = true;
            var steps = game.GetStepsForLevel();

            SetAllLEDs(false);
            for (int i = 0; i < level; i++)
            {
                Thread.Sleep(200);
                TurnOnLED(steps[i], 400);
            }
            isAnimating = false;
        }
示例#2
0
        async Task ShowSequenceAnimation(int level)
        {
            if (isAnimating)
            {
                return;
            }
            isAnimating = true;

            var steps = game.GetStepsForLevel();

            SetAllLEDs(false);
            for (int i = 0; i < level; i++)
            {
                await Task.Delay(200);
                await TurnOnLED(steps[i], 400);
            }

            isAnimating = false;
        }