Ejemplo n.º 1
0
        /// 開始
        public bool Start()
        {
            ctrlPl.Start();
            ctrlHobit.Start();
            ctrlTo.Start();
            ctrlWall.Start();
            ctrlCam.Start();
            ctrlStg.Start();
            ctrlEffect.Start();
            ctrlEvent.Start();
            ctrlHouse.Start();
            ctrlMo.Start();

            InitSpriteBatch(4096, graphDev);
            SetSpriteCount(4096);

//		threadEn.Start();
            Scene2dTex.GetInstance().init(graphDev.Graphics);
            Scene2dTex.GetInstance().SetUpperPos(-400);
            Scene2dTex.GetInstance().SetUnderPos(950);
//		Scene2dTex.GetInstance().SetUpperPos(950);
//		Scene2dTex.GetInstance().SetUnderPos(-400);



            GameCtrlDrawManager.GetInstance().Start();
            return(true);
        }
Ejemplo n.º 2
0
        /// シーンの破棄
        public void Term()
        {
            /// ゲーム制御開始
            Scene2dTex.GetInstance().Term();
            GameCtrlManager.GetInstance().End();

            useSceneMgr = null;
        }
Ejemplo n.º 3
0
        private void FrameEat()
        {
            if ((CtrlCam.camModeId == CtrlCamera.ModeId.NormalToCloseLook || CtrlCam.camModeId == CtrlCamera.ModeId.CloseLook) && EatingStart > 0)
            {
                EatingStart--;
                if (ToothVector == true)
                {
                    Scene2dTex.GetInstance().SetUpperPos(-200 - EatingStart * 20);
                    Scene2dTex.GetInstance().SetUnderPos(750 + EatingStart * 20);
                }
                else
                {
                    Scene2dTex.GetInstance().SetUpperPos(750 + EatingStart * 20);
                    Scene2dTex.GetInstance().SetUnderPos(-200 - EatingStart * 20);
                }
            }

            if ((CtrlCam.camModeId == CtrlCamera.ModeId.Normal) && EatingStart < 10)
            {
                EatingStart++;
                if (ToothVector == true)
                {
                    Scene2dTex.GetInstance().SetUpperPos(-200 - EatingStart * 20);
                    Scene2dTex.GetInstance().SetUnderPos(750 + EatingStart * 20);
                }
                else
                {
                    Scene2dTex.GetInstance().SetUpperPos(750 + EatingStart * 20);
                    Scene2dTex.GetInstance().SetUnderPos(-200 - EatingStart * 20);
                }
            }
//		Scene2dTex.GetInstance().SetUpperPos(-400);
//		Scene2dTex.GetInstance().SetUnderPos(950);
            if (CtrlCam.camModeId == CtrlCamera.ModeId.CloseLook ||
                CtrlCam.camModeId == CtrlCamera.ModeId.NormalToCloseLook ||
                CtrlCam.camModeId == CtrlCamera.ModeId.CloseLookToNormal)
            {
                if (EatingFlag == true || EatingNow == true)
                {
                    EatingCount++;
                    EatingFlag = false;
                    EatingNow  = true;
                    if (EatingCount < 5)
                    {
                        if (ToothVector == true)
                        {
                            Scene2dTex.GetInstance().SetUpperPos(-200 + EatingCount * 300 / 5);
                            Scene2dTex.GetInstance().SetUnderPos(750 - EatingCount * 300 / 5);
                        }
                        else
                        {
                            Scene2dTex.GetInstance().SetUpperPos(750 - EatingCount * 300 / 5);
                            Scene2dTex.GetInstance().SetUnderPos(-200 + EatingCount * 300 / 5);
                        }
                    }
                    else if (5 <= EatingCount && EatingCount < 10)
                    {
                        if (ToothVector == true)
                        {
                            Scene2dTex.GetInstance().SetUpperPos(100 - (EatingCount - 5) * 300 / 5);
                            Scene2dTex.GetInstance().SetUnderPos(450 + (EatingCount - 5) * 300 / 5);
                        }
                        else
                        {
                            Scene2dTex.GetInstance().SetUpperPos(450 + (EatingCount - 5) * 300 / 5);
                            Scene2dTex.GetInstance().SetUnderPos(100 - (EatingCount - 5) * 300 / 5);
                        }
                    }
                    if (EatingCount == 10)
                    {
                        if (ToothVector == true)
                        {
                            Scene2dTex.GetInstance().SetUpperPos(-200 - EatingStart * 20);
                            Scene2dTex.GetInstance().SetUnderPos(750 + EatingStart * 20);
                        }
                        else
                        {
                            Scene2dTex.GetInstance().SetUpperPos(750 + EatingStart * 20);
                            Scene2dTex.GetInstance().SetUnderPos(-200 - EatingStart * 20);
                        }
                        EatingCount = 0;
                        EatingNow   = false;
                        EatingFlag  = false;
                    }
                }
            }

            if (eatingBoss == true)
            {
                if (ToothVector == true)
                {
                    Scene2dTex.GetInstance().SetUpperPos(950);
                    Scene2dTex.GetInstance().SetUnderPos(-400);
                }
                else
                {
                    Scene2dTex.GetInstance().SetUpperPos(-400);
                    Scene2dTex.GetInstance().SetUnderPos(950);
                }
            }
        }
Ejemplo n.º 4
0
        /// 全コントロールの描画
        public void Draw()
        {
            graphDev.Graphics.SetTexture(0, StaticDataList.textureUnified);

            ctrlCam.Draw(graphDev);

            if (countTime <= (int)Data.SetupValue.EnemyAppearTime - 50)
            {
                ctrlStg.setBrightness(0.0f);
            }
            else if ((int)Data.SetupValue.EnemyAppearTime - 50 < countTime && countTime <= (int)Data.SetupValue.EnemyAppearTime)
            {
                ctrlStg.setBrightness(1.0f - ((int)Data.SetupValue.EnemyAppearTime - countTime) / 50.0f);
            }
            else if ((int)Data.SetupValue.EnemyAppearTime < countTime && countTime <= (int)Data.SetupValue.EnemyAppearTime + (int)Data.SetupValue.EnemyAppearingTime - 50)
            {
                ctrlStg.setBrightness(1.0f);
            }
            else if ((int)Data.SetupValue.EnemyAppearTime + (int)Data.SetupValue.EnemyAppearingTime - 50 < countTime && countTime < (int)Data.SetupValue.EnemyAppearTime + (int)Data.SetupValue.EnemyAppearingTime)
            {
                ctrlStg.setBrightness((((int)Data.SetupValue.EnemyAppearTime + (int)Data.SetupValue.EnemyAppearingTime) - countTime) / 50.0f);
            }
            else if ((int)Data.SetupValue.EnemyAppearTime + (int)Data.SetupValue.EnemyAppearingTime < countTime && countTime < (int)Data.SetupValue.EnemyAppearTime + (int)Data.SetupValue.EnemyAppearingTime + 200)
            {
                ctrlStg.setBrightness(0.0f);
            }
            else if ((int)Data.SetupValue.EnemyAppearTime + (int)Data.SetupValue.EnemyAppearingTime + 200 < countTime)
            {
                countTime = 0;
            }
            ctrlStg.Draw(graphDev);

//		int allNumber = ctrlMo.GetActiveNum() + ctrlHobit.GetActiveNum() + ctrlHouse.GetActiveNum() + ctrlTo.GetActiveNum() + ctrlWall.GetActiveNum() + Scene2dTex.GetInstance().GetObjNumber();
            int allNumber = ctrlMo.GetActiveNum() + ctrlHobit.GetActiveNum() + CtrlHobit.speakCount + ctrlHouse.GetActiveNum() + ctrlTo.GetActiveNum() + ctrlWall.GetActiveNum() + 1;

            if (allNumber > 4096)
            {
                 allNumber = 4096;
            }
            SetSpriteCount(allNumber);

            if (eatingBoss == true)
            {
                ctrlPl.Draw(graphDev);
            }

            ClearSpriteCounter();

            while (true)
            {
                SetDrawFlag();

                if (EnemyDrawFlag == true)
                {
                    ctrlHobit.DrawIdx(graphDev, EnemyNumber);
                    EnemyNumber++;
                    EnemyDrawFlag = false;
                }

                if (TowerDrawFlag == true)
                {
                    ctrlTo.DrawIdx(graphDev, TowerNumber);
                    TowerNumber++;
                    TowerDrawFlag = false;
                }

                if (HouseDrawFlag == true)
                {
                    ctrlHouse.DrawIdx(graphDev, HouseNumber);
                    HouseNumber++;
                    HouseDrawFlag = false;
                }

                if (MonumentDrawFlag == true)
                {
                    ctrlMo.DrawIdx(graphDev, MonumentNumber);
                    MonumentNumber++;
                    MonumentDrawFlag = false;
                }

                if (WallDrawFlag == true)
                {
                    ctrlWall.DrawIdx(graphDev, WallNumber);
                    WallNumber++;
                    WallDrawFlag = false;
                }



                if ((EnemyNumber == ctrlHobit.GetActiveNum() || ctrlHobit.GetActiveNum() == 0) &&
                    (TowerNumber == ctrlTo.GetActiveNum() || ctrlTo.GetActiveNum() == 0) &&
                    (HouseNumber == ctrlHouse.GetActiveNum() || ctrlHouse.GetActiveNum() == 0) &&
                    (WallNumber == ctrlWall.GetActiveNum() || ctrlWall.GetActiveNum() == 0) &&
                    (MonumentNumber == ctrlMo.GetActiveNum() || ctrlMo.GetActiveNum() == 0))
                {
                    EnemyNumber      = 0;
                    TowerNumber      = 0;
                    HouseNumber      = 0;
                    WallNumber       = 0;
                    MonumentNumber   = 0;
                    EnemyDrawFlag    = false;
                    TowerDrawFlag    = false;
                    HouseDrawFlag    = false;
                    WallDrawFlag     = false;
                    MonumentDrawFlag = false;
                    break;
                }
            }
            batch.Draw(graphDev);

            ctrlHobit.DrawText(graphDev);

            Scene2dTex.GetInstance().Draw();

            for (int i = 0; i < spriteCount; i++)
            {
                sprites[i].UpdatePosTex();
            }


            /*
             * for(int i=0;i<spriteCount;i++){
             *      sprites[i].UpdateAll();
             * }
             * spriteCount = 8000;
             */
            /// 半透明の物は奥から描く
            GameCtrlDrawManager.GetInstance().EntryStart();
            if (eatingBoss == false)
            {
                ctrlPl.Draw(graphDev);
            }
            ctrlEffect.Draw(graphDev);
            GameCtrlDrawManager.GetInstance().SortFar();
            GameCtrlDrawManager.GetInstance().Draw(graphDev);
        }
Ejemplo n.º 5
0
        /// 全コントロールのUpdate
        public void Frame()
        {
            /*
             * Console.WriteLine(GetMs());
             * Console.WriteLine(ctrlHobit.GetEntryNum()+ctrlTo.GetEntryNum()+ctrlHouse.GetEntryNum()+ctrlWall.GetEntryNum());
             * Console.WriteLine();
             */
            countTime++;

            if (changePlAni == true)
            {
                if (changePlMode == false)
                {
//				ctrlPl.changeAnimation(true);
                    changePlMode = true;
                }
                else if (changePlMode == true)
                {
//				ctrlPl.changeAnimation(false);
                    changePlMode = false;
                }
                changePlAni = false;
            }

            makeHouseAndEnTimer();
            if (AddEnemyFromMo == true)
            {
                if (CtrlHobit.stateId == CtrlHobit.CtrlStateId.Move)
                {
                    AddEnemyFromMonument();
                }
                AddEnemyFromMo = false;
            }

            if (AddEnemyFromNecro == true)
            {
                ctrlHobit.EntryAddEnemy((int)Data.Tex2dResId.Necromancer1, new Vector3(AddEnemyPos.X, 34.0f, AddEnemyPos.Z));
                AddEnemyFromNecro = false;
            }

            if (AddHouseFromMo == true)
            {
                AddHouseFromMonument();
                AddHouseFromMo = false;
            }

            if (battleStartFlag == true)
            {
                battleStart();
                battleStartFlag = false;
            }

            if (AddEffectFromEnemy == true)
            {
                ctrlPl.Addeffect(AddEnemyEffectPos);
                AddEffectFromEnemy = false;
            }

            if (AddTower == true)
            {
//			ctrlTo.EntryAddTower(StaticDataList.getRandom((int)Data.Tex2dResId.TowerStart+1,(int)(Data.Tex2dResId.TowerMax)),AddTowerPos);
                ctrlTo.EntryAddTower((int)Data.Tex2dResId.SouryoTower1, AddTowerPos);
                AppSound.GetInstance().PlaySeCamDis(AppSound.SeId.MakeMo, AddTowerPos);
                AddTower = false;
            }

            if (AddWall == true)
            {
                CtrlWall.EntryAddWall(StaticDataList.getRandom((int)Data.Tex2dResId.WallStart + 1, (int)Data.Tex2dResId.WallMax), AddWallPos1, AddWallPos2);
                AddWall = false;
            }

            if (EatCharNumber > 0)
            {
                Console.WriteLine(EatCharNumber);
                Scene2dTex.GetInstance().AddHp(EatCharNumber);
                switch (EatCharNumber)
                {
                case (int)Data.Tex2dResId.Noumin1:              CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.Senshi1:              CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.Souryo1:              CtrlPl.Hp = CtrlPl.Hp + 2;      break;

                case (int)Data.Tex2dResId.Zonbi1:               CtrlPl.Hp = CtrlPl.Hp + 1;      ctrlPl.Poision += 70; break;

                case (int)Data.Tex2dResId.Necromancer1: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.TowerStart:   CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SenshiTower1: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SenshiTower2: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SouryoTower1: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SouryoTower2: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.NouminHouse1: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.NouminHouse2: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.NouminHouse3: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.NouminHouse4: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.NouminHouse5: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SenshiHouse1: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SenshiHouse2: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SenshiHouse3: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SenshiHouse4: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SenshiHouse5: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SouryoHouse1: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SouryoHouse2: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SouryoHouse3: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SouryoHouse4: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.SouryoHouse5: CtrlPl.Hp = CtrlPl.Hp + 1;      break;

                case (int)Data.Tex2dResId.Gareki:               CtrlPl.Hp = CtrlPl.Hp + 0.5f;   break;

                case (int)Data.Tex2dResId.GarekiWall:   CtrlPl.Hp = CtrlPl.Hp + 0.5f;   break;

                case (int)Data.Tex2dResId.MakingWall1:  CtrlPl.Hp = CtrlPl.Hp + 0.5f;   break;

                case (int)Data.Tex2dResId.MakingWall2:  CtrlPl.Hp = CtrlPl.Hp + 0.5f;   break;

                case (int)Data.Tex2dResId.MakingWall3:  CtrlPl.Hp = CtrlPl.Hp + 0.5f;   break;
                }
                EatCharNumber = 0;
            }

            switch (SortNumber)
            {
            case 0: ctrlTo.setActiveChList();               ctrlTo.SortNear();                      break;

            case 1: ctrlWall.setActiveChList();             ctrlWall.SortNear();            break;

            case 2: ctrlHouse.setActiveChList();    ctrlHouse.SortNear();           break;

            case 3: ctrlMo.setActiveChList();               ctrlMo.SortNear();                      break;

            case 4: ctrlHobit.setActiveChList();    ctrlHobit.SortNear();           break;
            }

            SortNumber++;
            if (SortNumber > 8)
            {
                SortNumber = 0;
            }

            /*
             * threadEn = new Thread(new ThreadStart(ThreadEnFrame));
             * threadOther = new Thread(new ThreadStart(ThreadOtherFrame));
             * threadEn.Start();
             * threadOther.Start();
             */


            ctrlHobit.Frame();
            ctrlTo.Frame();
            ctrlWall.Frame();
            ctrlHouse.Frame();
            ctrlStg.Frame();
            ctrlEffect.Frame();
            ctrlMo.Frame();
            ctrlCam.Frame();
            ctrlStg.Frame();
            ctrlEffect.Frame();
            ctrlPl.Frame();
            FrameEat();
            Scene2dTex.GetInstance().SetHp(CtrlPl.Hp);
            Scene2dTex.GetInstance().frame();


            if (countTime % (int)Data.SetupValue.TweetTime == 0)
            {
                //SocketSample.GetInstance().sendData(StaticDataList.getRandom(1,5),StaticDataList.getRandom(0,10));
            }
        }