コード例 #1
0
 public void StopMusic()
 {
     if (audio != null)
     {
         audio.StopMusic();
     }
 }
コード例 #2
0
ファイル: EndingScene.cs プロジェクト: tamutamu/chaos
        public void Tick(EndingInput input)
        {
            if (numTicks == 0)
            {
                audio.StopMusic();
            }
            if (numTicks == 60)
            {
                audio.PlayMusic(GameMusic.Ending);
            }
            if (numTicks < 90 * 60)
            {
                numTicks++;
            }
            else
            {
                currentState = State.Exit;
            }

            if (input.Exit && !forceExit)
            {
                forceExit = true;
            }
            if (forceExit)
            {
                if (forceExitCount < 16)
                {
                    forceExitCount++;
                }
                else
                {
                    currentState = State.Exit;
                }
            }
        }
コード例 #3
0
ファイル: StageSelectScene.cs プロジェクト: tamutamu/chaos
        public void Tick(StageSelectInput input)
        {
            if (numUnlockedStages > 0 && !gotoGame && currentState != State.Exit)
            {
                if (input.Left && !input.Right)
                {
                    currentStageIndex--;
                    if (currentStageIndex < 0)
                    {
                        currentStageIndex += numUnlockedStages;
                    }
                }
                else if (input.Right && !input.Left)
                {
                    currentStageIndex = (currentStageIndex + 1) % numUnlockedStages;
                }
            }

            if (input.Start)
            {
                gotoGame = true;
            }

            if (input.Exit && !gotoGame)
            {
                currentState = State.Exit;
            }

            if (gotoGame)
            {
                if (gotoGameCount < 16)
                {
                    if (gotoGameCount == 0)
                    {
                        audio.StopMusic();
                    }
                    gotoGameCount++;
                }
                else
                {
                    currentState = State.GotoGame;
                }
            }
        }
コード例 #4
0
ファイル: TitleScene.cs プロジェクト: tamutamu/chaos
        public void Tick(TitleInput input)
        {
            if (numTicks == 0)
            {
                audio.StopMusic();
            }

            if (input.Exit)
            {
                exit = true;
            }

            numTicks++;

            switch (numTicks)
            {
            case 30:
                FireC();
                break;

            case 45:
                FireH();
                break;

            case 60:
                FireA();
                break;

            case 75:
                FireO();
                break;

            case 90:
                FireS();
                break;

            case 105:
                FireL();
                break;

            case 120:
                FireU();
                break;

            case 135:
                FireG();
                break;

            case 165:
                game.Quake(16);
                game.Flash(128);
                game.ShowTitle();
                game.PlaySound(GameSound.Explode);
                game.PlaySound(GameSound.TitleVoice);
                break;

            case 240:
                audio.PlayMusic(GameMusic.Title);
                break;
            }

            game.Tick(GameInput.Empty);

            if (!gotoGame && !exit)
            {
                if (input.Up)
                {
                    currentSelectIndex--;
                    if (!arcadeMode)
                    {
                        if (currentSelectIndex < 0)
                        {
                            currentSelectIndex += 3;
                        }
                    }
                    else
                    {
                        if (currentSelectIndex < 0)
                        {
                            currentSelectIndex += 2;
                        }
                    }
                }
                else if (input.Down)
                {
                    if (!arcadeMode)
                    {
                        currentSelectIndex = (currentSelectIndex + 1) % 3;
                    }
                    else
                    {
                        currentSelectIndex = (currentSelectIndex + 1) % 2;
                    }
                }

                if (input.Start)
                {
                    if (currentSelectIndex == 0)
                    {
                        gotoGame = true;
                    }
                    else if (currentSelectIndex == 1)
                    {
                        currentState = State.StageSelect;
                    }
                    else if (currentSelectIndex == 2)
                    {
                        exit = true;
                    }
                }
            }

            if (gotoGame)
            {
                if (gotoGameCount < 16)
                {
                    if (gotoGameCount == 0)
                    {
                        audio.StopMusic();
                    }
                    gotoGameCount++;
                }
                else
                {
                    currentState = State.GotoGame;
                }
            }
            else if (exit)
            {
                if (exitCount < 16)
                {
                    if (exitCount == 0)
                    {
                        audio.StopMusic();
                    }
                    exitCount++;
                }
                else
                {
                    currentState = State.Exit;
                }
            }
        }