Esempio n. 1
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            //ゲームデバイスの実体生成を取得
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            //シーンマネジャーの生成
            sceneManager = new SceneManager();
            //各シーンの追加
            sceneManager.Add(Scene.Scene.Load, new LoadScene());
            //sceneManager.Add(Scene.Scene.Title, new Title());
            //sceneManager.Add(Scene.Scene.GamePlay, new GamePlay());
            //sceneManager.Add(Scene.Scene.Ending, new Ending());
            //sceneManager.Add(Scene.Scene.GoodEnding, new GoodEnding());
            //sceneManager.Add(Scene.Scene.Load, new SceneFader(new LoadScene()));
            sceneManager.Add(Scene.Scene.Title, new SceneFader(new Title()));   //Secen追加
            IScene addScene = new GamePlay();

            sceneManager.Add(Scene.Scene.GamePlay, addScene);
            sceneManager.Add(Scene.Scene.Ending, new Ending());
            sceneManager.Add(Scene.Scene.GoodEnding, new GoodEnding());
            //一番最初のシーンを設定
            sceneManager.Change(Scene.Scene.Load);

            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //ゲームデバイスの実体生成
            gameDevice = new GameDevice(Content, GraphicsDevice);

            sound = gameDevice.GetSound();

            //描画オブジェクトの宣言
            renderer = gameDevice.GetRenderer();

            //csv管理のため削除
            //MapManager.Init();
            sceneManager = new SceneManager();
            //IScene playScene = new PlayScene(gameDevice);
            sceneManager.Add(SceneType.Title, new Title(gameDevice));

            //ステージクラスの追加
            //葉梨竜太
            //2016年10月12日
            sceneManager.Add(SceneType.Stage, new Stage(gameDevice));
            //ステージ選択の追加
            //葉梨竜太
            //2016年10月13日
            sceneManager.Add(SceneType.SmallStage, new SmallStage(gameDevice));
            sceneManager.Add(SceneType.PlayScene, new PlayScene(gameDevice, 0));
            sceneManager.Add(SceneType.Ending, new Ending(gameDevice));


            sceneManager.Change(new NextScene(SceneType.Title, -1));

            base.Window.Title = "プロメテウスの火";

            base.Initialize();  //絶対に消すな
        }
Esempio n. 3
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            //ゲームデバイスの実体を取得
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            //シーン管理生成
            sceneManager = new SceneManager();

            sceneManager.Add(Scene.SceneName.LoadScene, new LoadScene());
            sceneManager.Add(Scene.SceneName.GameTitle, new GameTitle());
            sceneManager.Add(Scene.SceneName.GamePlay, new GamePlay());
            sceneManager.Add(Scene.SceneName.Tutorial, new Tutorial());
            sceneManager.Add(Scene.SceneName.GameEnding, new GameEnding());

            //最初のシーンに変更
            sceneManager.Change(Scene.SceneName.LoadScene);

            //CSVReader csvReader = new CSVReader();
            //csvReader.Read("map.csv");

            #region ゴリラ
            //map = new Map(gameDevice);
            //map.Load("map.csv");
            //gameObjectManager.Add(map);
            #endregion


            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 4
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)0
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述

            //ゲームデバイスの実体を取得
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            //スコアの実体生成
            score = new Score();

            //タイマーの実体生成
            timer = new CountUpTimer(5000);

            sceneManager = new SceneManager();
            sceneManager.Add(Scene.Scene.Load, new LoadScene());
            sceneManager.Change(Scene.Scene.Load);
            sceneManager.Add(Scene.Scene.Title, new Title());
            sceneManager.Add(Scene.Scene.Logo, new Logo());
            sceneManager.Add(Scene.Scene.SelectScene, new SelectScene());
            sceneManager.Add(Scene.Scene.GamePlay, new GamePlay(score, timer));
            sceneManager.Add(Scene.Scene.Pause, new Pause());
            sceneManager.Add(Scene.Scene.Ending, new Ending(timer));
            sceneManager.Add(Scene.Scene.GameOver, new GameOver(score, timer));
            sceneManager.Add(Scene.Scene.TrueEnding, new TrueEnding(score, timer));

            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 5
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            sceneManager = new SceneManager();
            sceneManager.Add(Scene.Scene.Title, new Title());
            sceneManager.Add(Scene.Scene.GamePlay, new Gameplay());
            sceneManager.Add(Scene.Scene.Ending, new Ending());
            sceneManager.Change(Scene.Scene.Title);

            base.Initialize();
        }
Esempio n. 6
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            sceneManager = new SceneManager();
            sceneManager.Add(Scene.Scene.LoadScene, new LoadScene());
            sceneManager.Add(Scene.Scene.GamePlay, new GamePlay());
            sceneManager.Add(Scene.Scene.Result, new Result());
            sceneManager.Change(Scene.Scene.LoadScene);

            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 7
0
        protected override void Initialize()
        {
            GameDevice.Instance(Content, GraphicsDevice);

            mSceneManager = new SceneManager();
            mSceneManager.Add(Scene.Scene.Title, new Title());
            mSceneManager.Add(Scene.Scene.Rule, new RuleScene());
            mSceneManager.Add(Scene.Scene.StageSelect, new StageSelect());
            mSceneManager.Add(Scene.Scene.GamePlay, new GamePlay());
            mSceneManager.Add(Scene.Scene.Ending, new Ending());
            mSceneManager.Change(Scene.Scene.Title);

            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 8
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);
            //camera = new Camera_2D();
            //characterManager = new CharacterManager();

            sceneManager = new SceneManager();
            sceneManager.Add(Scene.Scene.Title, new Title());
            IScene addScene = new GamePlay();

            sceneManager.Add(Scene.Scene.GamePlay, addScene);
            sceneManager.Add(Scene.Scene.Tutorial, new Tutorial());
            sceneManager.Add(Scene.Scene.ResultD, (new ResultD(addScene)));
            sceneManager.Add(Scene.Scene.ResultC, (new ResultC(addScene)));
            sceneManager.Add(Scene.Scene.ResultB, (new ResultB(addScene)));
            sceneManager.Add(Scene.Scene.ResultA, (new ResultA(addScene)));
            sceneManager.Add(Scene.Scene.ResultS, (new ResultS(addScene)));
            sceneManager.Change(Scene.Scene.Title);

            //characterManager.Add(new Enemy());
            //characterManager.Add(new Player());

            //player = new Player();
            //enemy = new Enemy();

            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 9
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //ゲームデバイスの実体を取得
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            sceneManager = new SceneManager();
            sceneManager.Add(Scene.Scene.Title, new Title());
            sceneManager.Add(Scene.Scene.Select1, new Select1());
            sceneManager.Add(Scene.Scene.GamePlay, new GamePlay());
            sceneManager.Add(Scene.Scene.Menu, new Menu());

            sceneManager.Change(Scene.Scene.Title);


            base.Initialize();
        }
Esempio n. 10
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            //ゲームデバイスの実体を取得
            gameDevice   = GameDevice.Instance(Content, GraphicsDevice);
            sceneManager = new SceneManager();
            sceneManager.Add(Scene.Scene.Load, new Load());
            sceneManager.Add(Scene.Scene.Title, new Title());
            sceneManager.Add(Scene.Scene.GamePlay, new GamePlay());
            sceneManager.Add(Scene.Scene.GameOver, new GameOver());
            sceneManager.Change(Scene.Scene.Load);


            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 11
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);
            // この下にロジックを記述
            sceneManager = new SceneManager();
            sceneManager.Add(Scene.Scene.Title, new ScenFader(new Title()));
            IScene addScene = new GamePlay();

            sceneManager.Add(Scene.Scene.GamePlay, addScene);
            sceneManager.Add(Scene.Scene.Ending, new ScenFader(new Ending(addScene)));
            sceneManager.Add(Scene.Scene.GoodEnding, new GoodEnding(addScene));
            sceneManager.Change(Scene.Scene.Title);

            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 12
0
        protected override void Initialize()
        {
            gameDevice = new GameDevice(Content, graphicsDeviceManager.GraphicsDevice);
            camera2D   = new Camera2D(GraphicsDevice.Viewport, Parameter.StageSize);

            //シーン設定
            sceneManager = new SceneManager();
            sceneManager.Add(E_Scene.LOADING, new Loading(gameDevice));
            sceneManager.Add(E_Scene.TITLE, new Title(gameDevice));
            sceneManager.Add(E_Scene.CREATING, new Creating(gameDevice));
            sceneManager.Change(E_Scene.LOADING);

            Window.Title   = "StageCreator";
            IsMouseVisible = true;
            base.Initialize();
        }
Esempio n. 13
0
        protected override void Initialize()
        {
            GameDevice.Instance(Content, GraphicsDevice);

            mSceneManager = new SceneManager();
            mSceneManager.Add(Scene.Scene.Title, new Title());
            mSceneManager.Add(Scene.Scene.GamePlay, new GamePlay());
            mSceneManager.Change(Scene.Scene.Title);

            mHPUI = new HPUI();

            HitStop.mIsHitStop = false;

            GameDevice.Instance().GetRenderer().InitializeRenderTarget(Screen.WIDTH, Screen.HEIGHT);

            base.Initialize();
        }
Esempio n. 14
0
        protected override void Initialize()
        {
            gameDevice = new GameDevice(Content, graphicsDeviceManager.GraphicsDevice);
            camera2D   = new Camera2D(GraphicsDevice.Viewport, Parameter.StageSize);
            //bloom = new BloomComponent(this);
            //Components.Add(bloom);
            //bloom.Settings = new BloomSettings(null, 0.25f, 4, 2, 1, 1.5f, 1);


            //シーン設定
            sceneManager = new SceneManager();
            sceneManager.Add(E_Scene.LOADING, new Loading(gameDevice));
            sceneManager.Add(E_Scene.TITLE, new Title(gameDevice));
            sceneManager.Add(E_Scene.GAMEPLAY, new GamePlay(gameDevice));
            sceneManager.Add(E_Scene.OPERATE, new Operate(gameDevice));
            sceneManager.Add(E_Scene.STAFFROLL, new StaffRoll(gameDevice));
            sceneManager.Add(E_Scene.ENDING, new Ending(gameDevice));
            sceneManager.Add(E_Scene.CLEAR, new Clear(gameDevice));
            sceneManager.Change(E_Scene.LOADING);

            Window.Title = "Season";

            //Windowの大きさチェンジ
            //Window.AllowUserResizing = false;
            //Window.BeginScreenDeviceChange(false);
            //Window.EndScreenDeviceChange(Window.ScreenDeviceName, (int)(Parameter.ScreenSize.X * 1.5f), (int)(Parameter.ScreenSize.Y * 1.5f));

            base.Initialize();
        }
Esempio n. 15
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            renderer = gameDevice.GetRenderer();

            // この下にロジックを記述
            renderer.LoadContent("black");
            renderer.LoadContent("gyoza");
            renderer.LoadContent("kamato");
            renderer.LoadContent("pipo-btleffect");
            renderer.LoadContent("stage");
            renderer.LoadContent("white");
            renderer.LoadContent("particle");
            renderer.LoadContent("particleBlue");
            renderer.LoadContent("EnemyBullet");
            renderer.LoadContent("Cloud");



            Sound  sound    = gameDevice.GetSound();
            string filepath = "";       //after

            sound.LoadBGM("gameplaybgm", filepath);

            sound.LoadSE("shot", filepath);
            sound.LoadSE("die", filepath);
            sound.LoadSE("hit", filepath);
            sound.LoadSE("kill", filepath);


            sceneManager = new SceneManager();

            IScene gamePlayScene = new GamePlayScene();

            sceneManager.Add(Scene.Scene.GamePlay, gamePlayScene);
            sceneManager.Add(Scene.Scene.Ending, new Ending(gamePlayScene));



            // この上にロジックを記述
            base.Initialize();            // 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 16
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            sceneManager = new SceneManager();
            sceneManager.Add(Scene.Scene.Title, new Transition(new Title(), null));
            IScene addScene = new GamePlay();

            sceneManager.Add(Scene.Scene.GamePlay, new Transition(addScene, null));
            sceneManager.Add(Scene.Scene.Ending, new Transition(new Ending(addScene), null));
            sceneManager.Add(Scene.Scene.Clear, new Transition(new Clear(addScene), null));
            sceneManager.Change(Scene.Scene.Title);

            //sceneManager.Add(Scene.Scene.Ending, addScene);

            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 17
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            //ゲームデバイスの実体を取得
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            //シーン管理生成
            sceneManager = new SceneManager();

            sceneManager.Add(SceneName.LoadScene, new LoadScene());
            sceneManager.Add(SceneName.GameTitle, new GameTitle());
            sceneManager.Add(SceneName.GamePlay, new GamePlay());
            sceneManager.Add(SceneName.GameEnding, new GameEnding());

            //最初のシーンに変更
            sceneManager.Change(SceneName.LoadScene);


            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 18
0
File: game.cs Progetto: tincann/AGR
        public void Init(OpenTKApp app, CancellationToken exitToken)
        {
            _exitToken = exitToken;
            _app       = app;
            _tasks     = new Task[parallelBundles];
            _r         = RNG.CreateMultipleRNGs(parallelBundles);

            Screen.Clear(0x2222ff);
            _acc = new Accumulator(Screen);

            //var tracer = new WhittedStyleTracer();
            var tracer = new PathTracer();

            _scene        = new Scene(tracer, constructBVH: true);
            _sceneManager = new SceneManager(_camera, _scene);

            _sceneManager.Add(SceneDefinitions.Default);
            _sceneManager.Add(SceneDefinitions.DarkRoom);
            _sceneManager.Add(SceneDefinitions.PathTracerBoxCool);
            _sceneManager.Add(SceneDefinitions.PathTracerBox);
            _sceneManager.Add(SceneDefinitions.BeerTest);
            _sceneManager.Add(SceneDefinitions.Teapot);

            _sceneManager.SetScene(0);

            Statistics.Enabled = false;
        }
Esempio n. 19
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述
            gameDevice   = GameDevice.Instance(Content, GraphicsDevice);
            Window.Title = "うんこ";
            sceneManager = new SceneManager();
            sceneManager.Add(SceneName.Title, new Title());
            sceneManager.Add(SceneName.Load, new Load());
            IScene addScene = new GamePlay();

            sceneManager.Add(SceneName.GamePlay, addScene);



            sceneManager.Change(SceneName.Title);
            bgmLoader = new BGMLoader(new string[, ] {
                { "GamePlay1", "./Sound/" }
            });
            bgmLoader.Initialize();
            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 20
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            sceneManager = new SceneManager();
            IScene addScene = new Title();

            sceneManager.Add(Scene.Scene.Title, addScene);
            IScene addScene2 = new Tutorial();

            sceneManager.Add(Scene.Scene.Tutorial, addScene2);
            IScene addScene3 = new GameMain();

            sceneManager.Add(Scene.Scene.GameMain, addScene3);
            IScene addScene4 = new Ending();

            sceneManager.Add(Scene.Scene.Ending, addScene4);
            sceneManager.Change(Scene.Scene.Title);


            base.Initialize();
        }
Esempio n. 21
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述

            //ゲームデバイスの実体生成と取得
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);

            sceneManager = new SceneManager();
            //sceneManager.Add(Scene.Scene.Title, new SceneFader(new Title()));       //シーンフェーダーを追加
            CountUpTimer scoreTimer = new CountUpTimer();
            IScene       addScene   = new GamePlay(scoreTimer);

            sceneManager.Add(Scene.Scene.Title, new Title());
            sceneManager.Add(Scene.Scene.GamePlay, addScene);
            sceneManager.Add(Scene.Scene.Ending, new Ending(addScene, scoreTimer));
            // sceneManager.Add(Scene.Scene.Ending, new SceneFader(new Ending(addScene)));
            sceneManager.Change(Scene.Scene.Title);             //最初のシーンはタイトルに変更

            timer   = new CountDownTimer(30);
            timerUI = new TimerUI(timer);
            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 22
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            Window.Title = "ShootingGame";

            gameDevice = new GameDevice(Content, GraphicsDevice);       //GameDeviceインスタンスを生成
            inputState = gameDevice.GetInputState();

            //Scene管理の生成
            sceneManager = new SceneManager();

            //各Sceneの生成と追加
            IScene gamePlay = new GamePlay();

            sceneManager.Add(SceneType.Title, new Title());
            sceneManager.Add(SceneType.GamePlay, gamePlay);
            sceneManager.Add(SceneType.Ending, new Ending(gamePlay));
            sceneManager.Add(SceneType.Load, new Load());

            //最初のSceneに移行
            sceneManager.Change(SceneType.Load);

            base.Initialize();
        }
Esempio n. 23
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Globals.ObjectRemoved        += OnObjectRemoved;
            Globals.Update               += OnUpdate;
            Globals.UpdateActorSequences += OnUpdateSequences;
            Globals.ActorAdded           += OnActorAdded;

            // Init our Screen Manager
            Manager = new SceneManager(Globals.Game);

            // Create our Rendering Window
            Globals.Renderer = new Renderer(Globals.Game);
            Manager.Add(Globals.Renderer);
        }
Esempio n. 24
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //ゲームデバイスの実体生成
            gameDevice = new GameDevice(Content, GraphicsDevice);

            sound = gameDevice.GetSound();

            //描画オブジェクトの宣言
            renderer = gameDevice.GetRenderer();

            base.Window.Title = "プロメテウスの火";

            base.Initialize();  //絶対に消すな

            sceneManager = new SceneManager();
            //IScene playScene = new PlayScene(gameDevice);
            sceneManager.Add(SceneType.Load, new Load(gameDevice));

            sceneManager.Add(SceneType.Title, new Title(gameDevice, this.Exit));

            //ステージクラスの追加
            //葉梨竜太
            //2016年10月12日
            sceneManager.Add(SceneType.Stage, new Stage(gameDevice));

            sceneManager.Add(SceneType.StageIn, new StageIn(1.0f));

            sceneManager.Add(SceneType.Credit, new Credit(gameDevice));
            //ステージ選択の追加
            //葉梨竜太
            //2016年10月13日
            sceneManager.Add(SceneType.SmallStage, new SmallStage(gameDevice));
            sceneManager.Add(SceneType.PlayScene, new PlayScene(gameDevice, 0));

            //エンディング演出追加 by柏 2017.1.11
            //sceneManager.Add(SceneType.ToEnd, new ToEnd(1.2f));
            sceneManager.Add(SceneType.Ending, new Ending(gameDevice));


            sceneManager.Change(new NextScene(SceneType.Load, -1));
        }
Esempio n. 25
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            Engine.Initialize(this, graphics);



            base.Initialize();
            Chimera.Graphics.Effects.MotionBlur.Initialize(graphics, spriteBatch);
            game.Initalize();
            intro.Initialize();

            Chimera.Input.Mouse.Graphic.Initialize(new Vector2(70, 80));

            SceneManager.Add("Intro", new Scene(intro.Draw, intro.Update));
            SceneManager.Add("Jeu", new Scene(game.Draw, game.Update));

            SceneManager.Current = "Intro";// TO CHANGE
        }
Esempio n. 26
0
        public virtual void InitializeGame()
        {
            // Setup world global object


            // Initialize GTraphics Manager
            _gm = new GraphicsManager(this);
            _sm = SceneManager.Instance;
            Scene top = new Scene();

            _sm.Add(top);

            // Start the game loop thread
            _gameLoop = ThreadManager.CreateThread(GameLoop);
            _gameLoop.Start();


            AssetsPath = Application.ExecutablePath + "\\Content";
            if (!Directory.Exists(AssetsPath))
            {
                // Break directory into it parts
                List <String> path = new List <String>(Application.ExecutablePath.Split('\\'));
                path.Remove(path.Last());
                // Go back a directory until we find content
                do
                {
                    path.Remove(path.Last());
                    AssetsPath = String.Format("{0}\\Content", String.Join("\\", path));
                } while (!Directory.Exists(AssetsPath) && path.Count > 0);
            }

            _physicsWorld   = new PhysicsWorld(World.WorldSize);
            _physicsFactory = new PhysicsFactory(_physicsWorld);
            if (!SingleThread)
            {
                // Start the Physics loop now that the world is created
                _physicsLoop = ThreadManager.CreateThread(PhysicsLoop);
                _physicsLoop.Start();
            }
        }
Esempio n. 27
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
            //Initialize the engine
            //Initialize le moteur
            Chimera.Engine.Initialize(this, graphics);
            //Add Intro and game screnn to the scen manager
            //Ajouter les scene intro et game au scene manager
            SceneManager.Add("intro", intro.update);
            SceneManager.Add("game", game.update);
            //Current Scene
            //La Scene Courante
            SceneManager.Current = "intro";

            //Initaize the game and intro scene
            //Initialse les scene intro et game
            game.initalize();
            intro.initalize();
            Chimera.GUI.MainWindow.Properties.Title = "Graphics Desing by Ahmed Kechkach";
        }
Esempio n. 28
0
        /// <summary>
        /// 初期化処理(起動時、コンストラクタの後に1度だけ呼ばれる)
        /// </summary>
        protected override void Initialize()
        {
            // この下にロジックを記述

            //ゲームデバイスの実体を取得
            gameDevice = GameDevice.Instance(Content, GraphicsDevice);
            Renderer.Initialize(Content, GraphicsDevice); //レンダラーの初期化

            //シーンの登録
            var sceneManager = new SceneManager();

            sceneManager.Add(Scene.Scene.Loading, new LoadScene());
            sceneManager.Add(Scene.Scene.Title, new Title());
            sceneManager.Add(Scene.Scene.GamePlay, new GamePlay());
            sceneManager.Add(Scene.Scene.Menu, new Menu());
            sceneManager.Add(Scene.Scene.GameOver, new GameOver());
            sceneManager.Add(Scene.Scene.Ending, new Ending());
            sceneManager.Change(Scene.Scene.Loading);

            // この上にロジックを記述
            base.Initialize();// 親クラスの初期化処理呼び出し。絶対に消すな!!
        }
Esempio n. 29
0
        /// <summary>
        /// Set up a scene.
        /// </summary>
        /// <param name="name">Name of the region</param>
        /// <param name="id">ID of the region</param>
        /// <param name="x">X co-ordinate of the region</param>
        /// <param name="y">Y co-ordinate of the region</param>
        /// <param name="sizeX">X size of scene</param>
        /// <param name="sizeY">Y size of scene</param>
        /// <param name="configSource"></param>
        /// <returns></returns>
        public TestScene SetupScene(
            string name, UUID id, uint x, uint y, uint sizeX, uint sizeY, IConfigSource configSource)
        {
            Console.WriteLine("Setting up test scene {0}", name);

            // We must set up a console otherwise setup of some modules may fail
            MainConsole.Instance = new MockConsole();

            RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");

            regInfo.RegionName  = name;
            regInfo.RegionID    = id;
            regInfo.RegionSizeX = sizeX;
            regInfo.RegionSizeY = sizeY;
            regInfo.ServerURI   = "http://127.0.0.1:9000/";


            TestScene testScene = new TestScene(
                regInfo, m_acm, SimDataService, m_estateDataService, configSource, null);

            testScene.RegionInfo.EstateSettings             = new EstateSettings();
            testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();

            INonSharedRegionModule godsModule = new GodsModule();

            godsModule.Initialise(new IniConfigSource());
            godsModule.AddRegion(testScene);

            // Add scene to physics
            ((INonSharedRegionModule)m_physicsScene).AddRegion(testScene);
            ((INonSharedRegionModule)m_physicsScene).RegionLoaded(testScene);

            // Add scene to services
            m_assetService.AddRegion(testScene);

            if (m_cache != null)
            {
                m_cache.AddRegion(testScene);
                m_cache.RegionLoaded(testScene);
                testScene.AddRegionModule(m_cache.Name, m_cache);
            }

            m_assetService.RegionLoaded(testScene);
            testScene.AddRegionModule(m_assetService.Name, m_assetService);

            m_authenticationService.AddRegion(testScene);
            m_authenticationService.RegionLoaded(testScene);
            testScene.AddRegionModule(m_authenticationService.Name, m_authenticationService);

            m_inventoryService.AddRegion(testScene);
            m_inventoryService.RegionLoaded(testScene);
            testScene.AddRegionModule(m_inventoryService.Name, m_inventoryService);

            m_gridService.AddRegion(testScene);
            m_gridService.RegionLoaded(testScene);
            testScene.AddRegionModule(m_gridService.Name, m_gridService);

            m_userAccountService.AddRegion(testScene);
            m_userAccountService.RegionLoaded(testScene);
            testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);

            m_presenceService.AddRegion(testScene);
            m_presenceService.RegionLoaded(testScene);
            testScene.AddRegionModule(m_presenceService.Name, m_presenceService);

            testScene.SetModuleInterfaces();

            testScene.LandChannel = new TestLandChannel(testScene);
            testScene.LoadWorldMap();

            testScene.LoginsEnabled = true;
            testScene.RegisterRegionWithGrid();

            SceneManager.Add(testScene);

            return(testScene);
        }
Esempio n. 30
0
        /// <summary>
        /// Execute the region creation process.  This includes setting up scene infrastructure.
        /// </summary>
        /// <param name="regionInfo"></param>
        /// <param name="portadd_flag"></param>
        /// <param name="do_post_init"></param>
        /// <returns></returns>
        public void CreateRegion(RegionInfo regionInfo, bool portadd_flag, bool do_post_init, out IScene mscene)
        {
            int port = regionInfo.InternalEndPoint.Port;

            // set initial RegionID to originRegionID in RegionInfo. (it needs for loding prims)
            // Commented this out because otherwise regions can't register with
            // the grid as there is already another region with the same UUID
            // at those coordinates. This is required for the load balancer to work.
            // --Mike, 2009.02.25
            //regionInfo.originRegionID = regionInfo.RegionID;

            // set initial ServerURI
            regionInfo.HttpPort  = m_httpServerPort;
            regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString() + "/";

            regionInfo.osSecret = m_osSecret;

            if ((proxyUrl.Length > 0) && (portadd_flag))
            {
                // set proxy url to RegionInfo
                regionInfo.proxyUrl    = proxyUrl;
                regionInfo.ProxyOffset = proxyOffset;
                Util.XmlRpcCommand(proxyUrl, "AddPort", port, port + proxyOffset, regionInfo.ExternalHostName);
            }

            Scene scene = SetupScene(regionInfo, proxyOffset, Config);

            m_log.Info("[MODULES]: Loading Region's modules (old style)");

            // Use this in the future, the line above will be deprecated soon
            m_log.Info("[REGIONMODULES]: Loading Region's modules (new style)");
            IRegionModulesController controller;

            if (ApplicationRegistry.TryGet(out controller))
            {
                controller.AddRegionToModules(scene);
            }
            else
            {
                m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
            }

            if (m_securePermissionsLoading)
            {
                foreach (string s in m_permsModules)
                {
                    if (!scene.RegionModules.ContainsKey(s))
                    {
                        m_log.Fatal("[MODULES]: Required module " + s + " not found.");
                        Environment.Exit(0);
                    }
                }

                m_log.InfoFormat("[SCENE]: Secure permissions loading enabled, modules loaded: {0}", String.Join(" ", m_permsModules.ToArray()));
            }

            scene.SetModuleInterfaces();
// First Step of bootreport sequence
            if (scene.SnmpService != null)
            {
                scene.SnmpService.ColdStart(1, scene);
                scene.SnmpService.LinkDown(scene);
            }

            if (scene.SnmpService != null)
            {
                scene.SnmpService.BootInfo("Loading prins", scene);
            }

            while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
            {
                SetUpEstateOwner(scene);
            }

            // Prims have to be loaded after module configuration since some modules may be invoked during the load
            scene.LoadPrimsFromStorage(regionInfo.originRegionID);

            // TODO : Try setting resource for region xstats here on scene
            MainServer.Instance.AddStreamHandler(new RegionStatsHandler(regionInfo));

            scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
            scene.EventManager.TriggerParcelPrimCountUpdate();

            if (scene.SnmpService != null)
            {
                scene.SnmpService.BootInfo("Grid Registration in progress", scene);
            }

            try
            {
                scene.RegisterRegionWithGrid();
            }
            catch (Exception e)
            {
                m_log.ErrorFormat(
                    "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
                    e.Message, e.StackTrace);

                if (scene.SnmpService != null)
                {
                    scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
                }
                // Carrying on now causes a lot of confusion down the
                // line - we need to get the user's attention
                Environment.Exit(1);
            }

            if (scene.SnmpService != null)
            {
                scene.SnmpService.BootInfo("Grid Registration done", scene);
            }

            // We need to do this after we've initialized the
            // scripting engines.
            scene.CreateScriptInstances();

            if (scene.SnmpService != null)
            {
                scene.SnmpService.BootInfo("ScriptEngine started", scene);
            }

            SceneManager.Add(scene);

            //if (m_autoCreateClientStack)
            //{
            //    foreach (IClientNetworkServer clientserver in clientServers)
            //    {
            //        m_clientServers.Add(clientserver);
            //        clientserver.Start();
            //    }
            //}

            if (scene.SnmpService != null)
            {
                scene.SnmpService.BootInfo("Initializing region modules", scene);
            }
            scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };

            mscene = scene;

            if (scene.SnmpService != null)
            {
                scene.SnmpService.BootInfo("The region is operational", scene);
                scene.SnmpService.LinkUp(scene);
            }

            //return clientServers;
        }