Esempio n. 1
0
        public static void Win()
        {
            Console.WriteLine("We won!");
            MediaPlayer.Stop();

            SoundFactory.PlaySoundEffect(SoundFactory.YouWin());

            Task.Factory.StartNew(delegate()
            {
                Thread.Sleep(7200);
                SpriteLayer.YouWinLayer.AddSprite(SpriteLayer.YouWinLayer.youWin);
                int dy = 250;
                SpriteLayer.YouWinLayer.youWin.Info.bounds = new Rectangle(SpriteLayer.YouWinLayer.youWin.Info.x - 2, SpriteLayer.YouWinLayer.youWin.Info.y - dy, SpriteLayer.YouWinLayer.youWin.Info.spriteWidth + 2, SpriteLayer.YouWinLayer.youWin.Info.spriteHeight + dy);
                SpriteLayer.YouWinLayer.youWin.SetPosition(SpriteLayer.YouWinLayer.youWin.Info.x, SpriteLayer.YouWinLayer.youWin.Info.y - dy);
                SpriteLayer.YouWinLayer.youWin.Info.acceleration.Y = 0.15f;

                foreach (InputController ic in SpriteLayer.CollisionLayer.InputControllers)
                {
                    ic.Paused = true;
                }
            });
        }