コード例 #1
0
        public static void ChangeSceneInternal(GameObject pGameObject)
        {
            ForwardIterator pFor = new ForwardIterator(pGameObject);

            Component pNode = pFor.First();

            pFor.Next();
            if (pFor.IsDone())
            {
                GameObject pUFORoot = GameObjectMan.Find(GameObject.Name.UFORoot);
                UFO        pUFO     = (UFO)Iterator.GetChild(pUFORoot);
                pUFO.StopSound();

                int mode      = SceneStateGame.GetPlayMode();
                int currLevel = SceneStateGame.GetCurrLevel();

                String pScore1 = Int32.Parse(FontMan.Find(Font.Name.Score1).GetMessage()).ToString().PadLeft(4, '0');
                SceneStateGame.SetScore1(pScore1);

                String pScore2 = Int32.Parse(FontMan.Find(Font.Name.Score2).GetMessage()).ToString().PadLeft(4, '0');
                SceneStateGame.SetScore2(pScore2);

                String pScoreHigh = Int32.Parse(FontMan.Find(Font.Name.ScoreHigh).GetMessage()).ToString().PadLeft(4, '0');
                SceneStateGame.SetScoreHigh(pScoreHigh);

                SceneStateGame.SetStay(true);

                int currPlayer = SceneStateGame.GetCurrPlayer();

                if (currLevel == 1)
                {
                    SceneStateGame.SetPlayerLevel(currPlayer, 2);
                    SceneStateGame.SetBaseY(450.0f);
                    SceneStateGame.SetMoveRate(1.0f);
                }
                else
                {
                    SceneStateGame.SetPlayerLevel(currPlayer, 1);
                    SceneStateGame.SetBaseY(600.0f);
                    SceneStateGame.SetMoveRate(1.5f);
                    //no need to change to the next player, when finish level 2, same player, back to level 1
                    //SceneStateGame.SetCurrPlayer(currPlayer == mode ? 1 : 2);
                }

                //currLevel = SceneStateGame.GetCurrLevel();
                //if (currLevel == 1)
                //{
                //    SceneStateGame.SetBaseY(600.0f);
                //    SceneStateGame.SetMoveRate(1.5f);
                //}
                //else
                //{
                //    SceneStateGame.SetBaseY(450.0f);
                //    SceneStateGame.SetMoveRate(1.0f);
                //}

                Scene pScene = SceneMan.GetScene();
                pScene.Unload();
            }
        }
コード例 #2
0
        private void Reset()
        {
            SceneStateGame.SetScore1("0000");
            SceneStateGame.SetScore2("0000");

            SceneStateGame.SetBaseY(600.0f);
            SceneStateGame.SetPlayerLevel(1, 1);
            SceneStateGame.SetPlayerLevel(2, 1);

            SceneStateGame.SetMoveRate(1.5f);

            AlienGroup.ResetDirection();
        }
コード例 #3
0
        public override void Execute()
        {
            GameObject pUFORoot = GameObjectMan.Find(GameObject.Name.UFORoot);
            UFO        pUFO     = (UFO)Iterator.GetChild(pUFORoot);

            pUFO.StopSound();

            String pScore1    = Int32.Parse(FontMan.Find(Font.Name.Score1).GetMessage()).ToString().PadLeft(4, '0');
            String pScore2    = Int32.Parse(FontMan.Find(Font.Name.Score2).GetMessage()).ToString().PadLeft(4, '0');
            String pScoreHigh = Int32.Parse(FontMan.Find(Font.Name.ScoreHigh).GetMessage()).ToString().PadLeft(4, '0');

            if (this.state == false)
            {
                SceneStateGameover.SetScore1(pScore1);
                SceneStateGameover.SetScore2(pScore2);
                SceneStateGameover.SetScoreHigh(pScoreHigh);
            }

            SceneStateGame.SetScore1(pScore1);
            SceneStateGame.SetScore2(pScore2);
            SceneStateGame.SetScoreHigh(pScoreHigh);

            GameObjectNode pGhostGameObj = GhostGameObjectMan.Find(GameObject.Name.AlienGroup);

            if (pGhostGameObj != null)
            {
                SceneStateGame.SetLoadGhost(true);
            }

            GameObject pGameObj = GameObjectMan.Find(GameObject.Name.AlienGroup);

            GhostGameObjectMan.Attach(pGameObj);

            SceneStateGame.SetStay(this.state);
            Scene pScene = SceneMan.GetScene();

            pScene.Unload();
        }