/// 破棄 public void Term() { GameCtrlDrawManager.GetInstance().Term(); ctrlPl.Term(); ctrlHobit.Term(); ctrlTo.Term(); ctrlWall.Term(); ctrlCam.Term(); ctrlStg.Term(); ctrlEffect.Term(); ctrlEvent.Term(); ctrlDesMark.Term(); ctrlHouse.Term(); ctrlMo.Term(); ctrlPl = null; ctrlHobit = null; ctrlTo = null; ctrlWall = null; ctrlCam = null; ctrlStg = null; ctrlEffect = null; ctrlEvent = null; ctrlDesMark = null; ctrlHouse = null; ctrlMo = null; graphDev = null; }
/// public メソッド ///--------------------------------------------------------------------------- /// 初期化 public bool Init() { ctrlPl = new CtrlPlayer(); ctrlPl.Init(); ctrlHobit = new CtrlHobit(); ctrlHobit.Init(); ctrlTo = new CtrlTower(); ctrlTo.Init(); ctrlWall = new CtrlWall(); ctrlWall.Init(); ctrlCam = new CtrlCamera(); ctrlCam.Init(); ctrlStg = new CtrlStage(); ctrlStg.Init(); ctrlEffect = new CtrlEffect(); ctrlEffect.Init(); ctrlEvent = new CtrlEvent(); ctrlEvent.Init(); ctrlDesMark = new CtrlDestinationMark(); ctrlDesMark.Init(); ctrlHouse = new CtrlHouse(); ctrlHouse.Init(); ctrlMo = new CtrlMonument(); ctrlMo.Init(); GameCtrlDrawManager.GetInstance().Init(); EnemyNumber = 0; HouseNumber = 0; TowerNumber = 0; WallNumber = 0; MonumentNumber = 0; EnemyDrawFlag = false; TowerDrawFlag = false; WallDrawFlag = false; HouseDrawFlag = false; EatingFlag = false; MonumentDrawFlag = false; EatCharNumber = 0; AddEnemyFromMo = false; AddHouseFromMo = false; changePlAni = false; changePlMode = false; eatingBoss = false; AddEnemyFromNecro = false; battleStartFlag = false; AddEffectFromEnemy = false; AddTower = false; ZonbiNumber = 30; EnemyMoPos = new Vector3(-70.0f, 45.0f, 65.0f); countTime = 0; SortNumber = 0; nowFps = 0.0f; EatingNow = false; EatingCount = 0; EatingStart = 20; return true; }
/// 全コントロールの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)); } }
/// public メソッド ///--------------------------------------------------------------------------- /// 初期化 public bool Init() { ctrlPl = new CtrlPlayer(); ctrlPl.Init(); ctrlHobit = new CtrlHobit(); ctrlHobit.Init(); ctrlTo = new CtrlTower(); ctrlTo.Init(); ctrlWall = new CtrlWall(); ctrlWall.Init(); ctrlCam = new CtrlCamera(); ctrlCam.Init(); ctrlStg = new CtrlStage(); ctrlStg.Init(); ctrlEffect = new CtrlEffect(); ctrlEffect.Init(); ctrlEvent = new CtrlEvent(); ctrlEvent.Init(); ctrlDesMark = new CtrlDestinationMark(); ctrlDesMark.Init(); ctrlHouse = new CtrlHouse(); ctrlHouse.Init(); ctrlMo = new CtrlMonument(); ctrlMo.Init(); GameCtrlDrawManager.GetInstance().Init(); EnemyNumber = 0; HouseNumber = 0; TowerNumber = 0; WallNumber = 0; MonumentNumber = 0; EnemyDrawFlag = false; TowerDrawFlag = false; WallDrawFlag = false; HouseDrawFlag = false; EatingFlag = false; MonumentDrawFlag = false; EatCharNumber = 0; AddEnemyFromMo = false; AddHouseFromMo = false; changePlAni = false; changePlMode = false; eatingBoss = false; AddEnemyFromNecro = false; battleStartFlag = false; AddEffectFromEnemy = false; AddTower = false; ZonbiNumber = 30; EnemyMoPos = new Vector3(-70.0f, 45.0f, 65.0f); countTime = 0; SortNumber = 0; nowFps = 0.0f; EatingNow = false; EatingCount = 0; EatingStart = 20; return(true); }