Exemple #1
0
        public bool move()
        {
            SCENERESULT result;

            switch (mPhase)
            {
            case GAMEPHASE.RESET:
                mPhase = GAMEPHASE.INIT;
                goto case GAMEPHASE.INIT;

            case GAMEPHASE.INIT:
                mScene = new Title(this);
                mPhase = GAMEPHASE.TITLE;
                goto case GAMEPHASE.TITLE;

            case GAMEPHASE.TITLE:
                if (mScene != null)
                {
                    result = mScene.move();
                    if (result == SCENERESULT.DEFAULT)
                    {
                        break;
                    }
                    if (result == SCENERESULT.PROCEED)
                    {
                        mPhase = GAMEPHASE.GAME;
                        mScene = new Stage(this);
                        goto case GAMEPHASE.GAME;
                    }
                }
                break;

            case GAMEPHASE.GAME:
                if (mScene != null)
                {
                    result = mScene.move();
                    if (result == SCENERESULT.DEFAULT)
                    {
                        break;
                    }
                    mPhase = GAMEPHASE.CLEAR;
                    mScene = new Clear(this);
                    goto case GAMEPHASE.CLEAR;
                }
                break;

            case GAMEPHASE.CLEAR:
                if (mScene != null)
                {
                    result = mScene.move();
                    if (result == SCENERESULT.DEFAULT)
                    {
                        break;
                    }
                    mScene = new GameOver(this);
                    mPhase = GAMEPHASE.GAMEOVER;
                    goto case GAMEPHASE.GAMEOVER;
                }
                break;

            case GAMEPHASE.GAMEOVER:
                if (mScene != null)
                {
                    result = mScene.move();
                    if (result == SCENERESULT.DEFAULT)
                    {
                        break;
                    }
                    goto case GAMEPHASE.INIT;
                }
                break;

            default:
                break;
            }
            return(true);
        }
Exemple #2
0
 public GameObject(GameScene parent)
 {
     mScene = parent;
 }
Exemple #3
0
 public Selector(MainWindow app)
 {
     mPhase = GAMEPHASE.RESET;
     mApp   = app;
     mScene = null;
 }