Esempio n. 1
0
 /// <summary>
 /// 次のシーンへ遷移する。現在のシーンをスタックに残す。
 /// </summary>
 /// <param name="s">遷移するシーン</param>
 protected void CallScene(Scene s)
 {
     if (scenes.CurrentScene == this)
     {
         scenes.Push(s);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 初期化する
        /// </summary>
        /// <returns>成功したら0</returns>
        public int Init()
        {
            Configuration gconf = Configuration.GetGlobal();

            if (sensor.Init() != 0)
            {
                Error("Failed to initialize Kinect sensor");
                return(-1);
            }

            int screenX, screenY, screenBits;

            if (DX.GetScreenState(out screenX, out screenY, out screenBits) != 0)
            {
                Error("Failed to get screen state");
                return(-1);
            }
            gameSettings.WindowWidth  = screenX;
            gameSettings.WindowHeight = screenY;
            gameSettings.ScreenBits   = screenBits;
            gameSettings.GameLogic    = this;

            debugWindow.Height = screenY / 2 - 10;
            debugWindow.Width  = screenX / 4 - 10;
            debugWindow.Top    = screenY - debugWindow.Height - 5;
            debugWindow.Left   = 5;

            //serialPort.Open();

            /*
             * var mainScene = new MainScene();
             * mainScene.SerialPort = serialPort;
             * mainScene.Init(gameSettings);
             * sceneStack.Push(mainScene);
             */
            var s = new OpeningScene();

            s.SerialPort = serialPort;
            s.Init(gameSettings);
            sceneStack.Push(s);

            return(0);
        }