Exemple #1
0
        /// フレーム処理
        public bool Frame()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            for (int i = 0; i < actorList.Count; i++)
            {
                setMoveCollTrgObj(actorList[i]);
                setInterfereActor(actorList[i]);

                /// フレーム処理
                ///-------------------------------------
                if (actorList[i].Frame() == false)
                {
                    actorList[i].End();
                }

                /// 自身発生のイベントをチェック
                ///-------------------------------------
                if (actorList[i].EventCntr.Num > 0)
                {
                    ctrlResMgr.CtrlEvent.Play(actorList[i], actorList[i].EventCntr);
                }

                /// 登録削除
                ///-------------------------------------
                if (!actorList[i].Enable)
                {
                    actorList[i].End();
                    actorList[i].Term();
                    actorList.RemoveAt(i); // 要素の削除
                    i--;
                }
            }
            return(true);
        }
Exemple #2
0
        /// 描画
        public void Render()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;
            DemoGame.Graphics2D.DrawSpritesUseAlpha();
        }
        public bool renderEnemyEntry()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;

            DemoGame.Graphics2D.FillRect(0x80000000, 0, 0, useGraphDev.DisplayWidth, useGraphDev.DisplayHeight);

            DemoGame.Graphics2D.RemoveSprite("Mess");
            DemoGame.Graphics2D.AddSprite("Mess", "Entry Enemy", 0xff40ff40, 2, 2);
            DemoGame.Graphics2D.DrawSprites();

            for (int i = 0; i < enemyEntryStringList.Length; i++)
            {
                if (enemyId == i)
                {
                    DemoGame.Graphics2D.AddSprite("Mess" + i, enemyEntryStringList[i], 0xffff0000, 30, 50 + i * 28);
                }
                else
                {
                    DemoGame.Graphics2D.AddSprite("Mess" + i, enemyEntryStringList[i], 0xffffffff, 30, 50 + i * 28);
                }
                DemoGame.Graphics2D.DrawSprites();
            }

            useGraphDev.Graphics.SwapBuffers();

            for (int i = 0; i < enemyEntryStringList.Length; i++)
            {
                DemoGame.Graphics2D.RemoveSprite("Mess" + i);
            }
            DemoGame.Graphics2D.RemoveSprite("Mess");
            return(true);
        }
Exemple #4
0
        /// イベントの再生
        public void Play(GameActorProduct trgActor, GameActorEventContainer eveCntr)
        {
            if (eveCntr.Num > 0)
            {
                GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

                for (int i = 0; i < eveCntr.Num; i++)
                {
                    GameObjProduct trgObj = eveCntr.GetEntryObj(i);

                    /// ダメージ
                    if (eveCntr.GetEventId(i) == ActorEventId.Damage)
                    {
                        trgActor.SetEventDamage(trgObj, (Data.AttackTypeId)eveCntr.GetEntryAtb(i));
                    }

                    /// エフェクト再生
                    else if (eveCntr.GetEventId(i) == ActorEventId.Effect)
                    {
                        if (trgObj != null)
                        {
                            ctrlResMgr.CtrlEffect.EntryEffect((Data.EffTypeId)eveCntr.GetEntryAtb(i), trgObj);
                        }
                        else
                        {
                            ctrlResMgr.CtrlEffect.EntryEffect((Data.EffTypeId)eveCntr.GetEntryAtb(i), eveCntr.GetTrgPos(i));
                        }
                    }

                    /// 相手の方へ向く
                    else if (eveCntr.GetEventId(i) == ActorEventId.LookTrg)
                    {
                        trgActor.SetLookTrgPos(eveCntr.GetTrgPos(i));
                    }

                    /// 相手の方へ振り向く
                    else if (eveCntr.GetEventId(i) == ActorEventId.TurnTrg)
                    {
                        if (trgObj != null)
                        {
                            trgActor.SetEventTurnPos(new Vector3(trgObj.Mtx.M41, trgObj.Mtx.M42, trgObj.Mtx.M43), eveCntr.GetEntryAtb(i));
                        }
                    }

                    /// スーパーアーマー化
                    else if (eveCntr.GetEventId(i) == ActorEventId.SuperArm)
                    {
                        trgActor.SetEventSuperArm();
                    }

                    /// 動作キャンセル
                    else if (eveCntr.GetEventId(i) == ActorEventId.MvtCancel)
                    {
                        trgActor.SetEventMvtCancel();
                    }
                }
            }

            eveCntr.Clear();
        }
/// OBJの落下
///---------------------------------------------------------------------------

        public bool frameGravityObj()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            Vector3 movePos = trgObjPos;

            movePos.Y = 0.0f;

            /// 対象のOBJを登録
            moveCollMgr.TrgContainer.Clear();
            ctrlResMgr.CtrlStg.SetCollisionActor(moveCollMgr.TrgContainer, trgObjPos);

            shapeMove.Set(0, movePos, 0.001f);
            calCollGrav.GetMovePos(moveCollMgr, ref movePos);
            shapeMove.Set(0, trgObjPos, 0.001f);

            calCollGrav.Check(moveCollMgr, movePos);


            trgObjPos = calCollGrav.NextPos;
            setTrgObjMove(new Vector3(0.0f, 0.0f, 0.0f));

            changeTask(debugMenuTaskId.SelectObj);
            return(true);
        }
        /// フレーム処理
        public bool Update()
        {
            switch (nowTaskId)
            {
            case debugMenuTaskId.MenuTop:            frameMenuTop();         break;

            case debugMenuTaskId.EnemyEntry:         frameEnemyEntry();      break;

            case debugMenuTaskId.FixEntry:           frameFixEntry();        break;

            case debugMenuTaskId.EnemyPlace:         frameObjPlace();        break;

            case debugMenuTaskId.FixPlace:           frameObjPlace();        break;

            case debugMenuTaskId.LodParam:           frameLodParam();        break;

            case debugMenuTaskId.EnemyParam:         frameEnemyParam();      break;

            case debugMenuTaskId.EffCheck:           frameEffCheck();        break;

            case debugMenuTaskId.SoundCheck:         frameSoundCheck();      break;

            case debugMenuTaskId.GameSetup:          frameGameSetup();       break;

            case debugMenuTaskId.UpdatePlace:        frameUpdatePlace();     break;

            case debugMenuTaskId.SavePlaceParam:     frameSavePlaceParam();  break;
            }

            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            ctrlResMgr.CtrlCam.FramePlace(ctrlResMgr.CtrlPl.GetPos());

            return(true);
        }
        public bool renderEnemyParam()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;

            DemoGame.Graphics2D.FillRect(0x80000000, 0, 0, 300, 100);

            DemoGame.Graphics2D.AddSprite("Mess", "Lod Level Set", 0xff40ff40, 2, 2);

            uint col;

            col = (enemyId == 0)?    0xffff0000    : 0xffffffff;
            DemoGame.Graphics2D.AddSprite("Mess0",
                                          "EntryDis : " + ctrlResMgr.CtrlHobit.EntryAreaDis,
                                          col, 30, 50 + 0 * 28);
            col = (enemyId == 1)?    0xffff0000    : 0xffffffff;
            DemoGame.Graphics2D.AddSprite("Mess1",
                                          "StayCnt  : " + ctrlResMgr.CtrlHobit.EntryStayMax,
                                          col, 30, 50 + 1 * 28);

            DemoGame.Graphics2D.DrawSprites();
            useGraphDev.Graphics.SwapBuffers();

            DemoGame.Graphics2D.RemoveSprite("Mess");
            DemoGame.Graphics2D.RemoveSprite("Mess0");
            DemoGame.Graphics2D.RemoveSprite("Mess1");
            return(true);
        }
Exemple #8
0
        /// 干渉対象の登録
        private void setInterfereActor(ActorBulletBase actor)
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            /// 対象を登録
            ctrlResMgr.SetInterfereActorPl(actor.GetInterfereCntr());
        }
Exemple #9
0
        /// シーンの破棄
        public void Term()
        {
            GameCtrlManager.GetInstance().End();

            AppLyout.GetInstance().ClearSpriteAll();
            useSceneMgr = null;
        }
Exemple #10
0
        /// フレーム処理:FPS視点
        public bool framePlayModeFps()
        {
            plDrawFlg = false;

            /// フレーム処理
            ///-------------------------------------
            if (actorCh.GetStateId() == ActorChBase.StateId.Stand || actorCh.GetStateId() == ActorChBase.StateId.Move)
            {
                frameMoveFps();
            }
            else if (actorCh.GetStateId() == ActorChBase.StateId.Damage || actorCh.GetStateId() == ActorChBase.StateId.Dead)
            {
                setPlayMode(PlayModeId.Normal);
                GameCtrlManager.GetInstance().CtrlCam.ResetCamMode();
            }

            setMoveCollTrgObj();
            setinterfereActor();
            actorCh.Frame();

            if (spelDelayCnt > 0)
            {
                spelDelayCnt--;
            }
            return(true);
        }
Exemple #11
0
        /// 配置情報を書き込む
        private static void loadFirstSetup()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            ctrlResMgr.CtrlPl.SetPlace(0.0f, new Vector3(-10.0f, 15.0f, 0.0f));
            int     trgType;
            Vector3 trgPos = new Vector3();
            Vector3 trgRot = new Vector3();


            /// 敵情報の読み取り
            ///-----------------------------------------------------------
            if (SetupEnPlaceData.Version > 0)
            {
                SetupEnPlaceData data = new SetupEnPlaceData();
                int enNum             = data.PlaceData.GetLength(0);
                for (int i = 0; i < enNum; i++)
                {
                    trgType  = (int)data.PlaceData[i, 0];
                    trgPos.X = data.PlaceData[i, 1];
                    trgPos.Y = data.PlaceData[i, 2];
                    trgPos.Z = data.PlaceData[i, 3];
                    trgRot.Y = data.PlaceData[i, 4];
                    //ctrlResMgr.CtrlHobit.EntryAddEnemy( trgType, trgRot.Y, trgPos,(int)rand.Next(0,4) );
                }
            }
        }
Exemple #12
0
        /// 描画処理
        public bool Render()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;

            useGraphDev.Graphics.SetClearColor(0.9f, 0.9f, 0.9f, 0.0f);
            useGraphDev.Graphics.Clear();
            AppLyout.GetInstance().ClearSpriteAll();
            if (fadeFlag == true)
            {
                fadeCount++;
                if (fadeCount > 20)
                {
                    fadeCount = 20;
                }
            }
            AppLyout.GetInstance().RenderTitle(fadeCount);

            //AppDispEff.GetInstance().Draw( useGraphDev );

            useGraphDev.Graphics.SwapBuffers();

            return(true);
        }
Exemple #13
0
/// public メソッド
///---------------------------------------------------------------------------

        /// シーンの初期化
        public bool Init(DemoGame.SceneManager sceneMgr)
        {
            taskId      = 0;
            useSceneMgr = sceneMgr;

            AppLyout.GetInstance().ClearSpriteAll();

            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            if (ctrlResMgr.CtrlPl.Hp <= 0)
            {
                AppLyout.GetInstance().SetSprite(AppLyout.SpriteId.Mess_GAMEOVER);
                AppSound.GetInstance().PlayBgm(AppSound.BgmId.Gameover, false);
            }
            else
            {
                AppLyout.GetInstance().SetSprite(AppLyout.SpriteId.Mess_ENEMYALLCLEAR);
                AppSound.GetInstance().PlayBgm(AppSound.BgmId.Clear, false);
            }

            alphaCnt = 0;
            alpha    = 0.0f;

            return(true);
        }
        public bool renderGameSetup()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;

            DemoGame.Graphics2D.FillRect(0x80000000, 0, 0, useGraphDev.DisplayWidth, useGraphDev.DisplayHeight);

            DemoGame.Graphics2D.RemoveSprite("Mess");
            DemoGame.Graphics2D.AddSprite("Mess", "Game Setup", 0xff40ff40, 2, 2);
            DemoGame.Graphics2D.DrawSprites();

            for (int i = 0; i < gameSetupStringList.Length; i++)
            {
                uint col = 0xffffffff;
                if (gameSetupId == i)
                {
                    col = 0xffff0000;
                }

                switch (i)
                {
                case 0:
                    DemoGame.Graphics2D.AddSprite("Mess" + i, gameSetupStringList[i] +
                                                  "  : " + AppDebug.PlDrawFlg, col, 30, 50 + i * 28);
                    break;

                case 1:
                    DemoGame.Graphics2D.AddSprite("Mess" + i, gameSetupStringList[i] +
                                                  "  : " + AppDebug.ToonFlg, col, 30, 50 + i * 28);
                    break;

                case 2:
                    DemoGame.Graphics2D.AddSprite("Mess" + i, gameSetupStringList[i] +
                                                  "  : " + AppDebug.AtkStepPlay, col, 30, 50 + i * 28);
                    break;

                case 3:
                    DemoGame.Graphics2D.AddSprite("Mess" + i, gameSetupStringList[i] +
                                                  "  : " + AppDebug.GravityFlg, col, 30, 50 + i * 28);
                    break;

                case 4:
                    DemoGame.Graphics2D.AddSprite("Mess" + i, gameSetupStringList[i] +
                                                  "  : " + AppDebug.CollLightFlg, col, 30, 50 + i * 28);
                    break;
                }

                DemoGame.Graphics2D.DrawSprites();
            }

            useGraphDev.Graphics.SwapBuffers();

            for (int i = 0; i < gameSetupStringList.Length; i++)
            {
                DemoGame.Graphics2D.RemoveSprite("Mess" + i);
            }
            DemoGame.Graphics2D.RemoveSprite("Mess");
            return(true);
        }
        public bool renderSoundCheck()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;

            DemoGame.Graphics2D.FillRect(0x80000000, 0, 0, useGraphDev.DisplayWidth, useGraphDev.DisplayHeight);

            DemoGame.Graphics2D.AddSprite("Mess", "SoundTest", 0xff40ff40, 2, 2);

            if (soundTrg == 0)
            {
                DemoGame.Graphics2D.AddSprite("Mess1", "Bgm " + soundBgmNo, 0xffff0040, 30, 50 + 0 * 28);
                DemoGame.Graphics2D.AddSprite("Mess2", "Se " + soundSeNo, 0xff40ff40, 30, 50 + 1 * 28);
            }
            else
            {
                DemoGame.Graphics2D.AddSprite("Mess1", "Bgm " + soundBgmNo, 0xff40ff40, 30, 50 + 0 * 28);
                DemoGame.Graphics2D.AddSprite("Mess2", "Se " + soundSeNo, 0xffffff40, 30, 50 + 1 * 28);
            }
            DemoGame.Graphics2D.DrawSprites();

            useGraphDev.Graphics.SwapBuffers();

            DemoGame.Graphics2D.RemoveSprite("Mess");
            DemoGame.Graphics2D.RemoveSprite("Mess1");
            DemoGame.Graphics2D.RemoveSprite("Mess2");
            return(true);
        }
Exemple #16
0
/// public メソッド
///---------------------------------------------------------------------------

        /// シーンの初期化
        public bool Init(DemoGame.SceneManager sceneMgr)
        {
            /// ゲーム制御開始
            GameCtrlManager.GetInstance().Start();

            /// 配置情報のセット
            SetupObjPlaceData.Load();

            setupLyout();

            AppSound.GetInstance().PlayBgm(AppSound.BgmId.Main, true);

            AppDispEff.GetInstance().SetFadeIn(0xffffff, 10, true);

            useSceneMgr = sceneMgr;

            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;

            pauseFlag = false;


            return(true);
        }
        /// 初期配置情報のセット
        private void setPlaceTypeParam(int type)
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            trgObjIdx = 0;
            trgObjMax = 0;
            trgObjPos = ctrlResMgr.CtrlPl.GetPos();

            /// 敵
            if (type == 0)
            {
                trgObjMax = ctrlResMgr.CtrlHobit.GetEntryNum();
                if (trgObjMax > 0)
                {
                    setPlaceTrgParam(0);
                }
            }
            else
            {
                if (trgObjMax > 0)
                {
                    setPlaceTrgParam(0);
                }
            }
        }
/// 敵パラメータのセット
///---------------------------------------------------------------------------

        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);
        }
Exemple #19
0
        /*
         * public void changeAnimation(bool Flag){
         *      actorCh.changeAnimation(Flag);
         * }
         */


        /// フレーム:目的地への移動FPS視点
        private bool frameDestinationMoveFps()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            float rotY;
            float cal;
            float angleY;

            float mPow = moveSpeed;


            /// 目的地が設定されている場合
            ///----------------------------------------------------
            if (ctrlResMgr.CtrlStg.CheckDestinationTrg())
            {
                float trgDis = Common.VectorUtil.DistanceXZ(actorCh.BasePos, ctrlResMgr.CtrlStg.GetDestinationPos());

                GameActorProduct trgActor = ctrlResMgr.CtrlStg.GetDestinationActor();
                ShapeSphere      bndSph   = trgActor.GetBoundingShape();


                if (mPow > trgDis)
                {
                    mPow = trgDis;
                }

                /// 目的地到着
                if (trgDis <= mPow || (bndSph != null && trgDis <= bndSph.Sphre.R * 1.5f))
                {
                    ctrlResMgr.CtrlStg.ClearDestination();
                    actorCh.SetStateMove(new Vector3(actorCh.BaseMtx.M31, actorCh.BaseMtx.M32, actorCh.BaseMtx.M33), mPow, 0, false);

                    if (bndSph != null)
                    {
                        actorCh.Frame();
                        setPlayMode(PlayModeId.Normal);
                        actorCh.SetStateAttack(0);
                    }
                    return(false);
                }

                actorCh.SetLookTrgPos(ctrlResMgr.CtrlStg.GetDestinationPos());
            }

            /// 直進移動
            ///----------------------------------------------------
            else
            {
                rotY            = 180.0f + ctrlResMgr.CtrlCam.GetCamRotY() + AppInput.GetInstance().GetPlRotY();
                cal             = (float)(3.141593f / 180.0);
                angleY          = rotY * cal;
                actorCh.BaseMtx = Matrix4.RotationY(angleY);
                Common.MatrixUtil.SetTranslate(ref actorCh.BaseMtx, actorCh.BasePos);
                actorCh.SetPlace(actorCh.BaseMtx);
            }

            actorCh.SetStateMove(new Vector3(actorCh.BaseMtx.M31, actorCh.BaseMtx.M32, actorCh.BaseMtx.M33), mPow, 0, false);
            return(true);
        }
Exemple #20
0
        /// 干渉対象の登録
        private void setinterfereActor()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            /// 対象を登録

            ctrlResMgr.SetinterfereActorPl(actorCh.GetInterfereCntr());
        }
Exemple #21
0
        /// シーンの破棄
        public void Term()
        {
            /// ゲーム制御開始
            Scene2dTex.GetInstance().Term();
            GameCtrlManager.GetInstance().End();

            useSceneMgr = null;
        }
Exemple #22
0
        /// フレーム処理
        public bool Update()
        {
            switch (taskId)
            {
            case 0:
                if (AppSound.GetInstance().IsBgmPlaing() == false)
                {
                    AppLyout.GetInstance().SetSprite(AppLyout.SpriteId.TouchScreen);
                    taskId++;
                }
                break;

            case 1:
                if (AppInput.GetInstance().TouchRelease == true)
                {
                    alphaCnt = 0;
                    AppDispEff.GetInstance().SetFadeOut(0xffffff, 5, true);
                    taskId++;
                    break;
                }

                alphaCnt++;
                if (alphaCnt < 100)
                {
                    alpha += 0.02f;
                    if (alpha >= 1.0f)
                    {
                        alpha    = 1.0f;
                        alphaCnt = 100;
                    }
                }
                else
                {
                    alpha -= 0.02f;
                    if (alpha < 0.25f)
                    {
                        alpha    = 0.25f;
                        alphaCnt = 0;
                    }
                }
                break;

            case 2:
                if (AppDispEff.GetInstance().NowEffId != AppDispEff.EffId.FadeOut)
                {
                    useSceneMgr.Next((new SceneTitle()), false);
                }
                alpha = 0.0f;
                break;
            }

            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            ctrlResMgr.FrameResult();

            AppLyout.GetInstance().SetAlpha(AppLyout.SpriteId.TouchScreen, alpha);
            return(true);
        }
Exemple #23
0
        /// 描画処理
        public bool Render()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;

            useGraphDev.Graphics.SetClearColor(0.5f, 0.5f, 0.5f, 0.0f);
            useGraphDev.Graphics.Clear();

            /// ゲーム制御
            ctrlResMgr.Draw();

///     /// デバック用FPS表示
///     DemoGame.Graphics2D.AddSprite( "Fps", "ms : "+GameCtrlManager.GetInstance().GetMs()+
///                                                 " (Fps : "+((int)GameCtrlManager.GetInstance().GetFps())+")", 0xffffffff,
///                                                 2, useGraphDev.DisplayHeight-28 );
///
///     DemoGame.Graphics2D.AddSprite( "Mem", "CollNum : "+AppDebug.CollCnt+"(MS:"+AppDebug.TimeCal+")", 0xffffffff,
///                                                            2, useGraphDev.DisplayHeight-28*2 );
///     DemoGame.Graphics2D.AddSprite( "Wood", "("+AppDebug.WoodCnt+")", 0xffffffff, 2, useGraphDev.DisplayHeight-28*2 );
///     AppDebug.WoodCnt = 0;

//#if DEBUG
//        DemoGame.Graphics2D.AddSprite( "Fps", GameCtrlManager.GetInstance().GetMs()+ "ms", 0xffffffff, 0, 30);
//#endif

            AppDebug.CollCnt = 0;

            /// 開始からしばらくの間、メッセージを表示
            if (startMessCnt < 180)
            {
                renderStartMess();
                startMessCnt++;
            }

            if (pauseFlag == true)
            {
                renderPause();
            }

            /// レイアウトの描画
            AppLyout.GetInstance().Render();

            AppDispEff.GetInstance().Draw(useGraphDev);

            useGraphDev.Graphics.SwapBuffers();

            DemoGame.Graphics2D.RemoveSprite("Fps");
            DemoGame.Graphics2D.RemoveSprite("Mess");
            DemoGame.Graphics2D.RemoveSprite("Pause");

#if DEBUG_MODE
///        DemoGame.Graphics2D.RemoveSprite( "Mem" );
///        DemoGame.Graphics2D.RemoveSprite( "Wood" );
#endif
            return(true);
        }
Exemple #24
0
/// private メソッド
///---------------------------------------------------------------------------

        /// レイアウトのセット
        public void setupLyout()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            AppLyout.GetInstance().ClearSpriteAll();

            //setLyoutHp( ctrlResMgr.CtrlPl.GetHp() );
//        setLyoutEnNum( ctrlResMgr.CtrlHobit.GetEntryNum() );
        }
Exemple #25
0
        /// キャラクタの登録
        public void EntryCharacter(GameActorProduct actor, bool cullingFlg)
        {
            ShapeSphere bndSph = actor.GetBoundingShape();

            if (cullingFlg == false || cullingShape.CheckNearDis(bndSph.Sphre.Pos) < bndSph.Sphre.R)
            {
                float dis = Common.VectorUtil.Distance(actor.BasePos, GameCtrlManager.GetInstance().CtrlCam.GetCamPos());
                entryActor(actor, dis);
            }
        }
Exemple #26
0
/// private メソッド
///---------------------------------------------------------------------------

        /// 移動衝突対象OBJの登録
        private void setMoveCollTrgObj(ActorBulletBase actor)
        {
            GameCtrlManager      ctrlResMgr = GameCtrlManager.GetInstance();
            GameActorCollManager useCollMgr = actor.GetMoveCollManager();

            /// 移動する自身のOBJを登録
            useCollMgr.SetMoveShape(actor.GetUseObj(0).GetMoveShape());

            /// 対象を登録
            ctrlResMgr.SetCollisionActor(useCollMgr.TrgContainer, actor.BasePos);
        }
Exemple #27
0
        /// 登録開始
        public void EntryStart()
        {
            DemoGame.Camera camCore = GameCtrlManager.GetInstance().CtrlCam.GetCurrentCameraCore();
            Matrix4         mtx     = camCore.View.Inverse();

            Common.MatrixUtil.SetTranslate(ref mtx, camCore.Pos);
            cullingShape.SetMult(mtx);

            camPos = GameCtrlManager.GetInstance().CtrlCam.GetCamTrgPos();

            clear();
        }
Exemple #28
0
        /// フレーム:FPS移動
        private bool frameMoveFps()
        {
            Matrix4         rotMtx;
            float           rotY;
            float           cal;
            float           angleY;
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();


            /// カメラの方向を常に向く
            ///--------------------------------------------
            setCamVecTurn();


            /// カメラモード切替
            ///--------------------------------------------
            if (ctrlResMgr.CtrlCam.CheckModeChange())
            {
                setPlayMode(PlayModeId.Normal);
                return(true);
            }

            /// 移動
            ///--------------------------------------------
            if ((AppInput.GetInstance().Event & AppInput.EventId.Move) != 0)
            {
                rotY   = 180.0f + ctrlResMgr.CtrlCam.GetCamRotY() + AppInput.GetInstance().GetPlRotY();
                cal    = (float)(3.141593f / 180.0);
                angleY = rotY * cal;

                rotMtx = Matrix4.RotationY(angleY);

                actorCh.SetStateMove(new Vector3(rotMtx.M31, rotMtx.M32, rotMtx.M33), moveSpeed, 0.0f, false);
                /// キー入力が入った場合には目的地をキャンセル
                ctrlResMgr.CtrlStg.ClearDestination();
            }

            /// 目的地への移動
            ///--------------------------------------------
            else if (ctrlResMgr.CtrlStg.CheckDestination())
            {
                frameDestinationMoveFps();
            }

            /// 待機
            ///--------------------------------------------
            else
            {
                actorCh.SetStateStand();
            }

            return(true);
        }
        public bool renderSelectObj()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            DemoGame.GraphicsDevice useGraphDev = ctrlResMgr.GraphDev;

            DemoGame.Graphics2D.FillRect(0x80000000, 0, 0, useGraphDev.DisplayWidth, useGraphDev.DisplayHeight);

            if (trgObjType == 0)
            {
                DemoGame.Graphics2D.AddSprite("Mess", "Enemy Place TrgObj " + trgObjIdx, 0xff40ff40, 2, 2);
            }
            else
            {
                DemoGame.Graphics2D.AddSprite("Mess", "Fix Place TrgObj " + trgObjIdx, 0xff40ff40, 2, 2);
            }

            /// 未登録
            if (trgObjMax <= 0)
            {
                DemoGame.Graphics2D.AddSprite("Mess1", "OBJ No Entry", 0xffff0000, 30, 36);
            }

            /// 選択中のOBJ
            else
            {
                for (int i = 0; i < menuStringList.Length; i++)
                {
                    if (topMenuId == i)
                    {
                        DemoGame.Graphics2D.AddSprite("Mess" + i, menuStringList[i], 0xffff0000, 30, 36 + i * 28);
                    }
                    else
                    {
                        DemoGame.Graphics2D.AddSprite("Mess" + i, menuStringList[i], 0xffffffff, 30, 36 + i * 28);
                    }
                    DemoGame.Graphics2D.DrawSprites();
                }
            }

            /// スプライトの描画
            DemoGame.Graphics2D.DrawSprites();

            /// スプライトの削除
            DemoGame.Graphics2D.RemoveSprite("Mess");
            for (int i = 0; i < menuStringList.Length; i++)
            {
                DemoGame.Graphics2D.RemoveSprite("Mess" + i);
            }

            return(true);
        }
Exemple #30
0
/// public メソッド
///---------------------------------------------------------------------------

        /// 配置情報を書き込む
        public static bool Save()
        {
            GameCtrlManager ctrlResMgr = GameCtrlManager.GetInstance();

            // 既にファイルが存在する
            if (File.Exists(FILE_NAME))
            {
                File.Delete(FILE_NAME);
            }

            FileStream fs = new FileStream(FILE_NAME, FileMode.CreateNew);

            // ファイルを新規作成
            BinaryWriter w = new BinaryWriter(fs);

            Vector3 trgPos;

            /// プレイヤー情報の書き込み
            ///-----------------------------------------------------------
            trgPos = ctrlResMgr.CtrlPl.GetPos();
            w.Write((float)trgPos.X);
            w.Write((float)trgPos.Y);
            w.Write((float)trgPos.Z);
            w.Write(ctrlResMgr.CtrlPl.GetRotY());


            /// 敵情報の書き込み
            ///-----------------------------------------------------------
            int enNum = ctrlResMgr.CtrlHobit.GetEntryNum();

            w.Write((int)enNum);

            for (int i = 0; i < enNum; i++)
            {
                w.Write((int)ctrlResMgr.CtrlHobit.GetChTypeId(i));

                trgPos = ctrlResMgr.CtrlHobit.GetPos(i);
                w.Write((float)trgPos.X);
                w.Write((float)trgPos.Y);
                w.Write((float)trgPos.Z);
                w.Write(ctrlResMgr.CtrlHobit.GetRotY(i));
            }



            w.Close();
            fs.Close();

            saveEnList();

            return(true);
        }