Exemplo n.º 1
0
        private static async Task ScreenCrack()
        {
            await Task.Delay(1400);

            await UiThreadHelper.RunAsync(CoreDispatcherPriority.High, () =>
            {
                MainPage.ScreenEffectRef.Visibility = Visibility.Visible;
            });

            await Task.Delay(300);

            throw new InternalBufferOverflowException("Failed to handle explosion");
        }
Exemplo n.º 2
0
        private static async Task IgnitionStart(MediaElement mediaElement)
        {
            MainPage.BulbOn = false;
            await ExplodeSoundAsync(mediaElement);

            //Lock the UI.
            MainPage.Lock = true;

            await UiThreadHelper.RunAsync(CoreDispatcherPriority.High, () =>
            {
                MainPage.BuldEffectRef.Visibility = Visibility.Collapsed;
                MainPage.BuldRef.Source           = new BitmapImage(new Uri(MainPage.BaseUri, @"/Assets/bulboff.png"));
            });

            await Task.Delay(10);

            await Explosion();
        }
Exemplo n.º 3
0
        internal static async Task GasLeak()
        {
            MediaElement mediaElement = null;
            var          tuple        = await LoadStreamAsync();

            await UiThreadHelper.RunAsync(CoreDispatcherPriority.High, () =>
            {
                mediaElement          = new MediaElement();
                mediaElement.AutoPlay = false;
                mediaElement.SetSource(tuple.Item1, tuple.Item2);
            });

            await Task.Delay(3000);

            while (!MainPage.BulbOn)
            {
                await Task.Delay(10);
            }
            await IgnitionStart(mediaElement);
        }
Exemplo n.º 4
0
 internal static async Task ExplodeSoundAsync(MediaElement mysong)
 {
     await UiThreadHelper.RunAsync(CoreDispatcherPriority.Normal,
                                   () => mysong.Play());
 }