Esempio n. 1
0
        private async Task FallDown()
        {
            int fallingSpeed;

            while (!bottomCollision)
            {
                lock (speedMutex)
                {
                    fallingSpeed = speed;
                }
                await Task.Delay(fallingSpeed);

                await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    lock (moveMutex)
                    {
                        CheckForBottomCollision();
                        if (!bottomCollision)
                        {
                            actualTetramino.Fall();
                        }
                        else
                        {
                            ClearRows();
                        }
                    }
                });
            }
        }