Ejemplo n.º 1
0
        public override bool UpdateInitial(GameTime gt)
        {
            // Managing the loading bar.
            LoadingBarX += 5;

            if (LoadingBarX >= Main.SCREEN_WIDTH)
            {
                LoadingBarX = -261;
            }

            // Logic for managing the loader.
            if (LoadThread == null)
            {
                LoadFunc = () =>
                {
                    if (!Loaded)
                    {
                        try
                        {
                            if (this.Texture2DLoader != null)
                            {
                                this.Texture2DLoader.Load();
                            }

                            if (this.SoundEffectLoader != null)
                            {
                                this.SoundEffectLoader.Load();
                            }
                        }
                        catch
                        {
                            LoadThread.Abort();
                            Main.Quit();
                        }

                        Loaded = true;
                    }
                };

                LoadThread = new Thread(LoadFunc);
                LoadThread.Start();
            }
            else
            {
                if (LoadThread.ThreadState == ThreadState.Stopped)
                {
                    Main.SongPlayer.Open(Main.ContentManager.RootDirectory + "/Songs/GoFishingMotto.dat");
                    Main.SongPlayer.Play(true);
                    return(true);
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        public override void UpdateFinal(GameTime gt)
        {
            switch (TitleSelection.SelectedIndex)
            {
            case 0:
                Main.ChangeCurrentState(new Scene1());
                break;

            case 1:
                Main.ChangeCurrentState(new SaveLoadScreen(new Title(), false));
                break;

            case 2:
                Main.Quit();
                break;
            }
        }