Example #1
0
        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;
                }
            }
        }
Example #2
0
        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;
                }
            }
        }