Ejemplo n.º 1
0
 public void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (selectSound)
     {
         sound.Play(buffers.Ue, null);
     }
 }
Ejemplo n.º 2
0
 public void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (selectSound)
     {
         sound.Play(buffers.Ue, null);
     }
 }
Ejemplo n.º 3
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (!ShouldPlaySound())
     {
         return;
     }
     if (jumpSound)
     {
         sound.Play(buffers.Jump, this);
     }
     if (tiunSound)
     {
         sound.Play(buffers.Tiun, this);
     }
     if (coinSound)
     {
         sound.Play(buffers.Coin, this);
         if (Game.NumCoins > 0)
         {
             sound.Play(buffers.Hyakuyen, this);
         }
         else
         {
             sound.Play(buffers.Stiana, this);
         }
     }
 }
Ejemplo n.º 4
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (fallSound)
     {
         sound.Play(buffers.Fall, this);
     }
 }
Ejemplo n.º 5
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (animation == 8)
     {
         sound.Play(buffers.Spring, this);
     }
 }
Ejemplo n.º 6
0
 public void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     foreach (Thing thing in list)
     {
         thing.PlaySound(sound, buffers);
     }
 }
Ejemplo n.º 7
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (animation == 8)
     {
         sound.Play(buffers.Spring, this);
     }
 }
Ejemplo n.º 8
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (!ShouldPlaySound()) return;
     if (pressSound)
     {
         sound.Play(buffers.Switch, this);
     }
 }
Ejemplo n.º 9
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (!ShouldPlaySound())
     {
         return;
     }
     if (moveCount == 0)
     {
         sound.Play(buffers.Lift, this);
     }
 }
Ejemplo n.º 10
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (!ShouldPlaySound())
     {
         return;
     }
     if (pressSound)
     {
         sound.Play(buffers.Switch, this);
     }
 }
Ejemplo n.º 11
0
Archivo: Box.cs Proyecto: sinshu/mafia
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (!ShouldPlaySound())
     {
         return;
     }
     if (MoveCount == 1)
     {
         sound.Play(buffers.BoxMove, this);
     }
     if (LandState == ON_GROUND && prevLandState == IN_AIR)
     {
         sound.Play(buffers.BoxFall, this);
     }
 }
Ejemplo n.º 12
0
 public void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     things.PlaySound(sound, buffers);
 }
Ejemplo n.º 13
0
 public void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     things.PlaySound(sound, buffers);
 }
Ejemplo n.º 14
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (fallSound)
     {
         sound.Play(buffers.Fall, this);
     }
 }
Ejemplo n.º 15
0
Archivo: Box.cs Proyecto: sinshu/mafia
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (!ShouldPlaySound()) return;
     if (MoveCount == 1)
     {
         sound.Play(buffers.BoxMove, this);
     }
     if (LandState == ON_GROUND && prevLandState == IN_AIR)
     {
         sound.Play(buffers.BoxFall, this);
     }
 }
Ejemplo n.º 16
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (!ShouldPlaySound()) return;
     if (jumpSound)
     {
         sound.Play(buffers.Jump, this);
     }
     if (tiunSound)
     {
         sound.Play(buffers.Tiun, this);
     }
     if (coinSound)
     {
         sound.Play(buffers.Coin, this);
         if (Game.NumCoins > 0)
         {
             sound.Play(buffers.Hyakuyen, this);
         }
         else
         {
             sound.Play(buffers.Stiana, this);
         }
     }
 }
Ejemplo n.º 17
0
 public void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     foreach (Thing thing in list)
     {
         thing.PlaySound(sound, buffers);
     }
 }
Ejemplo n.º 18
0
 public abstract void PlaySound(MafiaSound sound, MafiaBufferContainer buffers);
Ejemplo n.º 19
0
        public void Run()
        {
            form = new Form();
            // �E�B���h�E�T�C�Y�•ς̕����ǂ��ˁH
            form.Icon = MafiaLoader.DefaultLoader.GetIcon("mafia.ico");
            form.Text = Mafia.TITLE;

            stages = new Stage[numStages];
            for (int i = 0; i < numStages; i++)
            {
                if (i < Mafia.NUM_STAGES)
                {
                    stages[i] = MafiaLoader.DefaultLoader.GetStage("stage" + i + ".stg");
                }
                else
                {
                    stages[i] = MafiaLoader.DefaultLoader.GetStage(stagePath[i - Mafia.NUM_STAGES]);
                }
            }
            if (stagePath.Length == 0)
            {
                currentStageIndex = 0;
            }
            else
            {
                currentStageIndex = Mafia.NUM_STAGES;
            }

            title = new TitleScene();
            select = new SelectScene(stages, 0);

            state = TITLE_SCENE;

            video = new MafiaVideo(form, MessageBox.Show("�t���X�N���[���ŋN�����܂����H", "�m�F", MessageBoxButtons.YesNo) == DialogResult.Yes);
            sound = new MafiaSound(form);
            input = new MafiaInput(form);

            try
            {
                bgm = new Audio(Application.StartupPath + "\\" + Mafia.RESOURCE_NAME + "\\mafia.mp3");
                bgm.Ending += new EventHandler(bgm_Ending);
            }
            catch
            {
            }

            form.Show();

            timer = new FpsTimer(Mafia.FPS, false);

            while (CheckState())
            {
                if (input.ShouldToggleFullscreen())
                {
                    video.ToggleFullscreen();
                }
                switch (state)
                {
                    case TITLE_SCENE:
                        // �C�F���h�E�Anull���ǂ����`�F�b�N���Ȃ���Ȃ��Ƃ͉�����
                        if (bgm != null && bgm.Playing)
                        {
                            bgm.Stop();
                        }
                        switch (title.Tick(input.GetCurrentTitleInput()))
                        {
                            case TitleScene.NONE:
                                if (timer.ShouldRender() && video.CheckDrawable())
                                {
                                    video.Begin();
                                    video.DrawTitleScene(title);
                                    video.DrawFps(timer.GetCurrentFps());
                                    video.End();
                                    video.Present();
                                }
                                break;
                            case TitleScene.START_GAME:
                                select.CurrentStage = currentStageIndex;
                                state = SELECT_SCENE_TITLE;
                                break;
                            case TitleScene.EXIT:
                                form.Close();
                                break;
                        }
                        break;
                    case SELECT_SCENE_TITLE:
                        {
                            title.Tick(TitleInput.Empty);
                            int result = select.Tick(input.GetCurrentSelectInput());
                            switch (result)
                            {
                                case SelectScene.NONE:
                                    if (timer.ShouldRender() && video.CheckDrawable())
                                    {
                                        video.Begin();
                                        video.DrawTitleScene(title);
                                        video.DrawSelectScene(select);
                                        video.DrawFps(timer.GetCurrentFps());
                                        video.End();
                                        video.Present();
                                    }
                                    sound.PlaySelectSound(select);
                                    break;
                                case SelectScene.GOTO_TITLE:
                                    state = TITLE_SCENE;
                                    break;
                                default:
                                    state = GAME_SCENE;
                                    game = stages[currentStageIndex = result].CreateGame();
                                    break;
                            }
                        }
                        break;
                    case GAME_SCENE:
                        if (bgm != null && !bgm.Playing)
                        {
                            bgm.Play();
                        }
                        switch (game.Tick(input.GetCurrentGameInput()))
                        {
                            case GameScene.NONE:
                                if (timer.ShouldRender() && video.CheckDrawable())
                                {
                                    video.Begin();
                                    video.DrawGameScene(game);
                                    video.DrawFps(timer.GetCurrentFps());
                                    video.End();
                                    video.Present();
                                }
                                sound.PlayGameSound(game);
                                break;
                            case GameScene.RESET_GAME:
                                sound.StopSounds();
                                game = stages[currentStageIndex].CreateGame();
                                break;
                            case GameScene.CLEAR_GAME:
                                sound.StopSounds();
                                currentStageIndex = (currentStageIndex + 1) % numStages;
                                game = stages[currentStageIndex].CreateGame();
                                break;
                            case GameScene.SELECT:
                                if (timer.ShouldRender() && video.CheckDrawable())
                                {
                                    video.Begin();
                                    video.DrawGameScene(game);
                                    video.DrawFps(timer.GetCurrentFps());
                                    video.End();
                                    video.Present();
                                }
                                sound.PlayGameSound(game);
                                select.CurrentStage = currentStageIndex;
                                state = SELECT_SCENE_GAME;
                                break;
                            case GameScene.GOTO_TITLE:
                                sound.StopSounds();
                                state = TITLE_SCENE;
                                break;
                        }
                        break;
                    case SELECT_SCENE_GAME:
                        game.Tick(GameInput.Empty);
                        {
                            int result = select.Tick(input.GetCurrentSelectInput());
                            switch (result)
                            {
                                case SelectScene.NONE:
                                    if (timer.ShouldRender() && video.CheckDrawable())
                                    {
                                        video.Begin();
                                        video.DrawGameScene(game);
                                        video.DrawSelectScene(select);
                                        video.DrawFps(timer.GetCurrentFps());
                                        video.End();
                                        video.Present();
                                    }
                                    sound.PlayGameSound(game);
                                    sound.PlaySelectSound(select);
                                    break;
                                case SelectScene.GOTO_TITLE:
                                    sound.StopSounds();
                                    state = TITLE_SCENE;
                                    break;
                                default:
                                    sound.StopSounds();
                                    game = stages[currentStageIndex = result].CreateGame();
                                    state = GAME_SCENE;
                                    break;
                            }
                        }
                        break;
                }
                Application.DoEvents();
                timer.Wait();
            }

            if (bgm != null)
            {
                if (bgm.Playing)
                {
                    bgm.Stop();
                }
                bgm.Dispose();
                bgm = null;
            }
            video.Dispose();
            video = null;
            sound.Dispose();
            sound = null;
            input.Dispose();
            input = null;
        }
Ejemplo n.º 20
0
Archivo: Lift.cs Proyecto: sinshu/mafia
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
     if (!ShouldPlaySound()) return;
     if (moveCount == 0)
     {
         sound.Play(buffers.Lift, this);
     }
 }
Ejemplo n.º 21
0
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
 }
Ejemplo n.º 22
0
        public void Run()
        {
            form = new Form();
            // ウィンドウサイズ可変の方が良くね?
            form.Icon = MafiaLoader.DefaultLoader.GetIcon("mafia.ico");
            form.Text = Mafia.TITLE;

            stages = new Stage[numStages];
            for (int i = 0; i < numStages; i++)
            {
                if (i < Mafia.NUM_STAGES)
                {
                    stages[i] = MafiaLoader.DefaultLoader.GetStage("stage" + i + ".stg");
                }
                else
                {
                    stages[i] = MafiaLoader.DefaultLoader.GetStage(stagePath[i - Mafia.NUM_STAGES]);
                }
            }
            if (stagePath.Length == 0)
            {
                currentStageIndex = 0;
            }
            else
            {
                currentStageIndex = Mafia.NUM_STAGES;
            }

            title  = new TitleScene();
            select = new SelectScene(stages, 0);

            state = TITLE_SCENE;

            video = new MafiaVideo(form, MessageBox.Show("フルスクリーンで起動しますか?", "確認", MessageBoxButtons.YesNo) == DialogResult.Yes);
            sound = new MafiaSound(form);
            input = new MafiaInput(form);

            try
            {
                bgm         = new Audio(Application.StartupPath + "\\" + Mafia.RESOURCE_NAME + "\\mafia.mp3");
                bgm.Ending += new EventHandler(bgm_Ending);
            }
            catch
            {
            }

            form.Show();

            timer = new FpsTimer(Mafia.FPS, false);

            while (CheckState())
            {
                if (input.ShouldToggleFullscreen())
                {
                    video.ToggleFullscreen();
                }
                switch (state)
                {
                case TITLE_SCENE:
                    // イェンドウ、nullかどうかチェックしなきゃならんとは何事か
                    if (bgm != null && bgm.Playing)
                    {
                        bgm.Stop();
                    }
                    switch (title.Tick(input.GetCurrentTitleInput()))
                    {
                    case TitleScene.NONE:
                        if (timer.ShouldRender() && video.CheckDrawable())
                        {
                            video.Begin();
                            video.DrawTitleScene(title);
                            video.DrawFps(timer.GetCurrentFps());
                            video.End();
                            video.Present();
                        }
                        break;

                    case TitleScene.START_GAME:
                        select.CurrentStage = currentStageIndex;
                        state = SELECT_SCENE_TITLE;
                        break;

                    case TitleScene.EXIT:
                        form.Close();
                        break;
                    }
                    break;

                case SELECT_SCENE_TITLE:
                {
                    title.Tick(TitleInput.Empty);
                    int result = select.Tick(input.GetCurrentSelectInput());
                    switch (result)
                    {
                    case SelectScene.NONE:
                        if (timer.ShouldRender() && video.CheckDrawable())
                        {
                            video.Begin();
                            video.DrawTitleScene(title);
                            video.DrawSelectScene(select);
                            video.DrawFps(timer.GetCurrentFps());
                            video.End();
                            video.Present();
                        }
                        sound.PlaySelectSound(select);
                        break;

                    case SelectScene.GOTO_TITLE:
                        state = TITLE_SCENE;
                        break;

                    default:
                        state = GAME_SCENE;
                        game  = stages[currentStageIndex = result].CreateGame();
                        break;
                    }
                }
                break;

                case GAME_SCENE:
                    if (bgm != null && !bgm.Playing)
                    {
                        bgm.Play();
                    }
                    switch (game.Tick(input.GetCurrentGameInput()))
                    {
                    case GameScene.NONE:
                        if (timer.ShouldRender() && video.CheckDrawable())
                        {
                            video.Begin();
                            video.DrawGameScene(game);
                            video.DrawFps(timer.GetCurrentFps());
                            video.End();
                            video.Present();
                        }
                        sound.PlayGameSound(game);
                        break;

                    case GameScene.RESET_GAME:
                        sound.StopSounds();
                        game = stages[currentStageIndex].CreateGame();
                        break;

                    case GameScene.CLEAR_GAME:
                        sound.StopSounds();
                        currentStageIndex = (currentStageIndex + 1) % numStages;
                        game = stages[currentStageIndex].CreateGame();
                        break;

                    case GameScene.SELECT:
                        if (timer.ShouldRender() && video.CheckDrawable())
                        {
                            video.Begin();
                            video.DrawGameScene(game);
                            video.DrawFps(timer.GetCurrentFps());
                            video.End();
                            video.Present();
                        }
                        sound.PlayGameSound(game);
                        select.CurrentStage = currentStageIndex;
                        state = SELECT_SCENE_GAME;
                        break;

                    case GameScene.GOTO_TITLE:
                        sound.StopSounds();
                        state = TITLE_SCENE;
                        break;
                    }
                    break;

                case SELECT_SCENE_GAME:
                    game.Tick(GameInput.Empty);
                    {
                        int result = select.Tick(input.GetCurrentSelectInput());
                        switch (result)
                        {
                        case SelectScene.NONE:
                            if (timer.ShouldRender() && video.CheckDrawable())
                            {
                                video.Begin();
                                video.DrawGameScene(game);
                                video.DrawSelectScene(select);
                                video.DrawFps(timer.GetCurrentFps());
                                video.End();
                                video.Present();
                            }
                            sound.PlayGameSound(game);
                            sound.PlaySelectSound(select);
                            break;

                        case SelectScene.GOTO_TITLE:
                            sound.StopSounds();
                            state = TITLE_SCENE;
                            break;

                        default:
                            sound.StopSounds();
                            game  = stages[currentStageIndex = result].CreateGame();
                            state = GAME_SCENE;
                            break;
                        }
                    }
                    break;
                }
                Application.DoEvents();
                timer.Wait();
            }

            if (bgm != null)
            {
                if (bgm.Playing)
                {
                    bgm.Stop();
                }
                bgm.Dispose();
                bgm = null;
            }
            video.Dispose();
            video = null;
            sound.Dispose();
            sound = null;
            input.Dispose();
            input = null;
        }
Ejemplo n.º 23
0
Archivo: Door.cs Proyecto: sinshu/mafia
 public override void PlaySound(MafiaSound sound, MafiaBufferContainer buffers)
 {
 }
Ejemplo n.º 24
0
 public abstract void PlaySound(MafiaSound sound, MafiaBufferContainer buffers);