/// 備品の登録 ///--------------------------------------------------------------------------- public bool frameFixEntry() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; /// 初期化 if (nowSubTask == 0) { enemyId = 0; nowSubTask++; } if ((pad.Trig & DemoGame.InputGamePadState.Up) != 0) { enemyId--; if (enemyId < 0) { enemyId = fixEntryStringList.Length - 1; } } if ((pad.Trig & DemoGame.InputGamePadState.Down) != 0) { enemyId = (enemyId + 1) % fixEntryStringList.Length; } return(true); }
/// 破棄 public void Term() { eventId = 0; useGPad = null; useTouch = null; multiTapParam = null; }
/// public メソッド ///--------------------------------------------------------------------------- /// 初期化 public bool Init(DemoGame.InputGamePad pad, DemoGame.InputTouch touch, DemoGame.GraphicsDevice gDev) { useGPad = pad; useTouch = touch; plRotY = 0.0f; camRotX = 0.0f; camRotY = 0.0f; eventId = 0; touchRelease = false; singleTouchFlg = false; singleDTapCnt = 0; backTouchNum = 0; plBehindFlg = false; ChangeCamFlag = false; ChangeCamFlag2 = false; multiTapParam = new cTapParam[2]; singleTapParam.Pos.X = 0; singleTapParam.Pos.Y = 0; singleTouchParam.Pos.X = 0; singleTouchParam.Pos.Y = 0; scrWidth = gDev.DisplayWidth; scrHeight = gDev.DisplayHeight; return(true); }
/// 敵パラメータのセット ///--------------------------------------------------------------------------- public bool frameEnemyParam() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { changeTask(debugMenuTaskId.MenuTop); return(true); } if (nowSubTask == 0) { enemyId = 0; nowSubTask++; } if ((pad.Trig & DemoGame.InputGamePadState.Up) != 0) { enemyId--; if (enemyId < 0) { enemyId = 1; } } if ((pad.Trig & DemoGame.InputGamePadState.Down) != 0) { enemyId = (enemyId + 1) % 2; } pad.SetRepeatParam(10, 2); if (enemyId == 0) { /* if( (pad.Repeat & DemoGame.InputGamePadState.Left) != 0 ){ * ctrlResMgr.CtrlEn.EntryAreaDis -= 0.5f; * } * else if( (pad.Repeat & DemoGame.InputGamePadState.Right) != 0 ){ * ctrlResMgr.CtrlEn.EntryAreaDis += 0.5f; * } */ } else { if ((pad.Repeat & DemoGame.InputGamePadState.Left) != 0) { ctrlResMgr.CtrlHobit.EntryStayMax--; } else if ((pad.Repeat & DemoGame.InputGamePadState.Right) != 0) { ctrlResMgr.CtrlHobit.EntryStayMax++; } } //ctrlResMgr.CtrlEn.Frame(); return(true); }
/// メニュートップ ///--------------------------------------------------------------------------- public bool frameMenuTop() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; /// デバックモードを抜ける if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { useSceneMgr.Prev(); return(true); } if ((pad.Trig & DemoGame.InputGamePadState.Up) != 0) { topMenuId--; if (topMenuId < 0) { topMenuId = menuTopStringList.Length - 1; } } if ((pad.Trig & DemoGame.InputGamePadState.Down) != 0) { topMenuId = (topMenuId + 1) % menuTopStringList.Length; } if ((pad.Trig & DemoGame.InputGamePadState.Circle) != 0) { switch (topMenuId) { case 0: changeTask(debugMenuTaskId.EnemyEntry); break; case 1: changeTask(debugMenuTaskId.EnemyPlace); break; case 2: changeTask(debugMenuTaskId.FixEntry); break; case 3: changeTask(debugMenuTaskId.FixPlace); break; case 4: changeTask(debugMenuTaskId.LodParam); break; case 5: changeTask(debugMenuTaskId.EnemyParam); break; case 6: changeTask(debugMenuTaskId.EffCheck); break; case 7: changeTask(debugMenuTaskId.SoundCheck); break; case 8: changeTask(debugMenuTaskId.GameSetup); break; case 9: changeTask(debugMenuTaskId.UpdatePlace); break; case 10: changeTask(debugMenuTaskId.SavePlaceParam); break; } } return(true); }
/// ゲーム制御系セットアップ ///--------------------------------------------------------------------------- public bool frameGameSetup() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; /// 初期化 if (nowSubTask == 0) { gameSetupId = 0; nowSubTask++; } if ((pad.Trig & DemoGame.InputGamePadState.Up) != 0) { gameSetupId--; if (gameSetupId < 0) { gameSetupId = gameSetupStringList.Length - 1; } } if ((pad.Trig & DemoGame.InputGamePadState.Down) != 0) { gameSetupId = (gameSetupId + 1) % gameSetupStringList.Length; } /// セットアップ if ((pad.Trig & DemoGame.InputGamePadState.Circle) != 0) { switch (gameSetupId) { case 0: AppDebug.PlDrawFlg = (AppDebug.PlDrawFlg == false)? true : false; break; case 1: AppDebug.ToonFlg = (AppDebug.ToonFlg == false)? true : false; break; case 2: AppDebug.AtkStepPlay = (AppDebug.AtkStepPlay == false)? true : false; break; case 3: AppDebug.GravityFlg = (AppDebug.GravityFlg == false)? true : false; break; case 4: AppDebug.CollLightFlg = (AppDebug.CollLightFlg == false)? true : false; break; } } /// 戻る else if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { changeTask(debugMenuTaskId.MenuTop); } return(true); }
/// 配置情報の保存 ///--------------------------------------------------------------------------- public bool frameSavePlaceParam() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; /// 初期化 if (nowSubTask == 0) { SetupObjPlaceData.Save(); nowSubTask++; } if (pad.Trig != 0) { changeTask(debugMenuTaskId.MenuTop); } return(true); }
/// 敵の登録 ///--------------------------------------------------------------------------- public bool frameEnemyEntry() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; /// 初期化 if (nowSubTask == 0) { enemyId = 0; nowSubTask++; } if ((pad.Trig & DemoGame.InputGamePadState.Up) != 0) { enemyId--; if (enemyId < 0) { enemyId = enemyEntryStringList.Length - 1; } } if ((pad.Trig & DemoGame.InputGamePadState.Down) != 0) { enemyId = (enemyId + 1) % enemyEntryStringList.Length; } /// 敵の登録 if ((pad.Trig & DemoGame.InputGamePadState.Circle) != 0) { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); //ctrlResMgr.CtrlEn.EntryAddEnemy( enemyId, 0.0f, ctrlResMgr.CtrlPl.GetPos(),0 ); changeTask(debugMenuTaskId.MenuTop); } /// 戻る else if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { changeTask(debugMenuTaskId.MenuTop); } return(true); }
/// フレーム処理(配置用) public bool FramePlace(Vector3 trgPos) { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; if ((pad.Scan & DemoGame.InputGamePadState.L) != 0) { worldDis -= 0.1f; if (worldDis < 1.0f) { worldDis = 1.0f; } } else if ((pad.Scan & DemoGame.InputGamePadState.R) != 0) { worldDis += 0.1f; } else { worldRot.X += AppInput.GetInstance().CamRotX; worldRot.Y += AppInput.GetInstance().CamRotY; } if (worldRot.Y > 360.0f) { worldRot.Y -= 360.0f; } else if (worldRot.Y < -360.0f) { worldRot.Y += 360.0f; } /// カメラにセットする行列を登録 actorBehind.SetMoveParam(worldMtx, trgPos, worldRot, worldDis, 2); actorBehind.Frame(); ctrlResMgr.GraphDev.SetCurrentCamera(actorBehind.Obj.CameraCore); return(true); }
/// LODパラメータのセット ///--------------------------------------------------------------------------- public bool frameLodParam() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { changeTask(debugMenuTaskId.MenuTop); return(true); } pad.SetRepeatParam(10, 2); if ((pad.Repeat & DemoGame.InputGamePadState.Left) != 0) { GameCtrlDrawManager.GetInstance().SetLodParam(lodNo, (GameCtrlDrawManager.GetInstance().GetLodParam(lodNo) - 1.0f)); } else if ((pad.Repeat & DemoGame.InputGamePadState.Right) != 0) { GameCtrlDrawManager.GetInstance().SetLodParam(lodNo, (GameCtrlDrawManager.GetInstance().GetLodParam(lodNo) + 1.0f)); } return(true); }
/// エフェクトチェック ///--------------------------------------------------------------------------- public bool frameEffCheck() { GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance(); DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { changeTask(debugMenuTaskId.MenuTop); return(true); } if ((pad.Trig & DemoGame.InputGamePadState.Left) != 0) { effNo--; if (effNo < 0) { effNo = (int)Data.EffTypeId.Max - 1; } } else if ((pad.Trig & DemoGame.InputGamePadState.Right) != 0) { effNo = (effNo + 1) % ((int)Data.EffTypeId.Max); } /// 再生 if ((pad.Trig & DemoGame.InputGamePadState.Circle) != 0) { Vector3 pos = ctrlResMgr.CtrlPl.GetPos(); pos.Y += 2.0f; ctrlResMgr.CtrlEffect.EntryEffect((Data.EffTypeId)effNo, pos); } ctrlResMgr.CtrlEffect.Frame(); return(true); }
/// フレーム処理 public bool Update() { AppDebug.CheckTimeStart(); #if DEBUG_MODE /// デバックモードへ DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { useSceneMgr.Next((new SceneDebugMenu()), true); return(true); } #endif if ((AppInput.GetInstance().Event & AppInput.EventId.Pause) != 0) { if (pauseFlag == false) { pauseFlag = true; } else if (pauseFlag == true) { pauseFlag = false; } } /// ゲーム制御 if (pauseFlag == false) { ctrlResMgr.Frame(); if (ctrlResMgr.CtrlHobit.changeStateFlag == true) { if (ctrlResMgr.CtrlHobit.stateId == CtrlHobit.CtrlStateId.BattleMove) { outputString = 0; } else if (ctrlResMgr.CtrlHobit.stateId == CtrlHobit.CtrlStateId.Battle) { outputString = 1; } else if (ctrlResMgr.CtrlHobit.stateId == CtrlHobit.CtrlStateId.MurderMove) { outputString = 2; } else if (ctrlResMgr.CtrlHobit.stateId == CtrlHobit.CtrlStateId.Murder) { outputString = 1; } else if (ctrlResMgr.CtrlHobit.stateId == CtrlHobit.CtrlStateId.Move) { outputString = 3; } startMessCnt = 0; ctrlResMgr.CtrlHobit.changeStateFlag = false; } } setupLyout(); AppDebug.CheckTimeEnd(); /// ゲームの終了チェック if (ctrlResMgr.CtrlPl.Hp <= 0 || ctrlResMgr.CtrlHobit.GetEntryNum() <= 0) { useSceneMgr.Next((new SceneGameResult()), true); return(true); } return(true); }
/// OBJの移動 ///--------------------------------------------------------------------------- public bool frameMoveObj() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; /// 戻る if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { changeTask(debugMenuTaskId.SelectObj); return(true); } /// 速度変更 if ((pad.Trig & DemoGame.InputGamePadState.Triangle) != 0) { trgObjMoveSpd += 1.0f; if (trgObjMoveSpd >= 8.0f) { trgObjMoveSpd = 1.0f; } } Vector3 move = new Vector3(0.0f, 0.0f, 0.0f); /// 回転 if ((pad.Scan & DemoGame.InputGamePadState.Square) != 0) { if ((pad.Scan & DemoGame.InputGamePadState.Left) != 0) { trgObjRot.Y -= (1.0f * trgObjMoveSpd); if (trgObjRot.Y <= 0.0f) { trgObjRot.Y += 360.0f; } } if ((pad.Scan & DemoGame.InputGamePadState.Right) != 0) { trgObjRot.Y += (1.0f * trgObjMoveSpd); if (trgObjRot.Y >= 360.0f) { trgObjRot.Y -= 360.0f; } } } /// 移動 else { if ((pad.Scan & DemoGame.InputGamePadState.Left) != 0) { move.X = -1.0f; } if ((pad.Scan & DemoGame.InputGamePadState.Right) != 0) { move.X = 1.0f; } if ((pad.Scan & DemoGame.InputGamePadState.Up) != 0) { move.Z = -1.0f; } if ((pad.Scan & DemoGame.InputGamePadState.Down) != 0) { move.Z = 1.0f; } if ((pad.Scan & DemoGame.InputGamePadState.Circle) != 0) { move.Y = 1.0f; } if ((pad.Scan & DemoGame.InputGamePadState.Cross) != 0) { move.Y = -1.0f; } } setTrgObjMove((move * trgObjMoveSpd * 0.01f)); return(true); }
/// メニュートップ ///--------------------------------------------------------------------------- public bool frameSelectObj() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; /// 戻る if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { useSceneMgr.Prev(); return(true); } /// 未登録 if (trgObjMax <= 0) { return(true); } if ((pad.Trig & DemoGame.InputGamePadState.Left) != 0) { trgObjIdx--; if (trgObjIdx < 0) { trgObjIdx = trgObjMax - 1; } setPlaceTrgParam(trgObjIdx); } else if ((pad.Trig & DemoGame.InputGamePadState.Right) != 0) { trgObjIdx = (trgObjIdx + 1) % trgObjMax; setPlaceTrgParam(trgObjIdx); } else if ((pad.Trig & DemoGame.InputGamePadState.Up) != 0) { topMenuId--; if (topMenuId < 0) { topMenuId = menuStringList.Length - 1; } } else if ((pad.Trig & DemoGame.InputGamePadState.Down) != 0) { topMenuId = (topMenuId + 1) % menuStringList.Length; } /// アクションの決定 else if ((pad.Trig & DemoGame.InputGamePadState.Circle) != 0) { switch (topMenuId) { case 0: changeTask(debugMenuTaskId.MoveObj); break; case 1: changeTask(debugMenuTaskId.GravityObj); break; case 2: changeTask(debugMenuTaskId.DeleteObj); break; } } return(true); }
/// サウンドチェック ///--------------------------------------------------------------------------- public bool frameSoundCheck() { DemoGame.InputGamePad pad = AppInput.GetInstance().Pad; if ((pad.Trig & DemoGame.InputGamePadState.Start) != 0) { changeTask(debugMenuTaskId.MenuTop); return(true); } if ((pad.Trig & DemoGame.InputGamePadState.Up) != 0) { soundTrg--; if (soundTrg < 0) { soundTrg = 1; } } else if ((pad.Trig & DemoGame.InputGamePadState.Down) != 0) { soundTrg = (soundTrg + 1) % 2; } if ((pad.Trig & DemoGame.InputGamePadState.Left) != 0) { if (soundTrg == 0) { soundBgmNo--; if (soundBgmNo < 0) { soundBgmNo = (int)AppSound.BgmId.Max - 1; } } else { soundSeNo--; if (soundSeNo < 0) { soundSeNo = (int)AppSound.SeId.Max - 1; } } } else if ((pad.Trig & DemoGame.InputGamePadState.Right) != 0) { if (soundTrg == 0) { soundBgmNo = (soundBgmNo + 1) % ((int)AppSound.BgmId.Max); } else { soundSeNo = (soundSeNo + 1) % ((int)AppSound.SeId.Max); } } /// 再生 if ((pad.Trig & DemoGame.InputGamePadState.Circle) != 0) { if (soundTrg == 0) { AppSound.GetInstance().PlayBgm((AppSound.BgmId)soundBgmNo, false); } else { AppSound.GetInstance().PlaySe((AppSound.SeId)soundSeNo); } } return(true); }
/// public メソッド ///--------------------------------------------------------------------------- /// 初期化 public bool Init( DemoGame.InputGamePad pad, DemoGame.InputTouch touch, DemoGame.GraphicsDevice gDev ) { useGPad = pad; useTouch = touch; plRotY = 0.0f; camRotX = 0.0f; camRotY = 0.0f; eventId = 0; touchRelease = false; singleTouchFlg = false; singleDTapCnt = 0; backTouchNum = 0; plBehindFlg = false; ChangeCamFlag = false; ChangeCamFlag2 = false; multiTapParam = new cTapParam[2]; singleTapParam.Pos.X = 0; singleTapParam.Pos.Y = 0; singleTouchParam.Pos.X = 0; singleTouchParam.Pos.Y = 0; scrWidth = gDev.DisplayWidth; scrHeight = gDev.DisplayHeight; return true; }