コード例 #1
0
        private void UpdateTitleScreen()
        {
            // update cursor position
            if (titleMenu > 0 && (titleState == TitleScreenState.Menu1 ||
                                  titleState == TitleScreenState.Menu2))
            {
                int loc = 7 + titleMenu * 2;

                for (int i = 9; i < 16; i += 2)
                {
                    SetText(i, 4, " ");

                    if (i == loc)
                    {
                        SetText(i, 4, "`");
                    }
                }
            }
            else if (titleState == TitleScreenState.LoadGame)
            {
                int loc = 7 + titleMenu;

                if (titleMenu > 0)
                {
                    loc++;
                }
                if (titleMenu == 9)
                {
                    loc++;
                }

                for (int i = 7; i < 19; i++)
                {
                    SetText(i, 5, " ");

                    if (i == loc)
                    {
                        SetText(i, 5, "`");
                    }
                }
            }

            switch (titleState)
            {
            case TitleScreenState.NewGameMusic:

                if (soundMan.IsPlaying(LotaSound.VeryGood) == false)
                {
                    SetNewGameText();

                    Wait(100);
                }

                break;
            }
        }
コード例 #2
0
ファイル: XleGameControl.cs プロジェクト: eylvisaker/Xle
        public async Task PlaySoundWait(LotaSound lotaSound, float maxTime_ms = 15000)
        {
            soundMan.PlaySound(lotaSound);

            await WaitAsync(150);

            int time = 0;

            while (soundMan.IsPlaying(lotaSound))
            {
                Debug.WriteLine($"Waiting for sound {lotaSound}... {time}");

                await WaitAsync(50);

                time += 50;
                if (time > maxTime_ms)
                {
                    break;
                }
            }
        }