Ejemplo n.º 1
0
 //Pause Screen is dismissed with Space!
 public override void HandleKeys(InputHelper aInputHelper, ISceneManager aSceneManager)
 {
     if (aInputHelper.IsNewPress(Keys.Space))
     {
         aSceneManager.HideOverlay();
     }
 }
Ejemplo n.º 2
0
 //Handle Key presses in the scene
 public void DoKeys(InputHelper aInputHelper)
 {
     if (iCurrentOverlay != null)
     {
         iCurrentOverlay.HandleKeys(aInputHelper, this);
     }
     else
     {
         iCurrentScene.HandleKeys(aInputHelper, this);
     }
 }
Ejemplo n.º 3
0
        //Show Pause screen with P
        public override void HandleKeys(InputHelper aInputHelper, ISceneManager aSceneManager)
        {
            //Show Pause Screen
            if (aInputHelper.IsNewPress(Keys.P))
            {
                aSceneManager.ShowOverlay(new Pause());
            }

            //Show The exit screen
            if (aInputHelper.IsNewPress(Keys.Escape))
            {
                aSceneManager.ShowOverlay(new ExitGameIntsance());
            }
        }
Ejemplo n.º 4
0
        public override void HandleKeys(InputHelper aInputHelper, ISceneManager aSceneManager)
        {
            //Close/Quit :)

            if(aInputHelper.IsNewPress(Keys.Q) || aInputHelper.IsNewPress(Keys.Enter) || aInputHelper.IsNewPress(Keys.Y))
            {
                Game1.ForceClose();
                return;
            }

            //We don't want to close quit - return to previous screen
            if (aInputHelper.IsNewPress(Keys.N) || aInputHelper.IsNewPress(Keys.Back))
            {
                aSceneManager.HideOverlay();
                return;
            }
        }
Ejemplo n.º 5
0
        public override void HandleKeys(InputHelper aInputHelper, ISceneManager aSceneManager)
        {
            //Does the user want to quit?
            if (aInputHelper.IsNewPress(Keys.Q) || aInputHelper.IsNewPress(Keys.Escape))
            {
                aSceneManager.ShowOverlay(new ExitGameIntsance());
                return;
            }

            //Else - Let's be silly!
            if (aInputHelper.IsCurPress(Keys.E) &&
                aInputHelper.IsCurPress(Keys.W) &&
                aInputHelper.IsCurPress(Keys.A) &&
                aInputHelper.IsCurPress(Keys.N))
            {
                //aSceneManager.SetScene(new SuperSpecialAwesomeScene());
                Console.WriteLine("Dylan smells!");
                return;
            }
        }
Ejemplo n.º 6
0
 public abstract void HandleKeys(InputHelper aInputHelper, ISceneManager aSceneManager);
Ejemplo n.º 7
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()
        {
            entityManager = new EntityManager();
            iSceneManager = new SceneManager(Content);

            iInputHelper = new InputHelper();

            iKinect = new KinectAdapter(graphics.GraphicsDevice, (isAvail) =>
            {
                string title = null;
                string file = null;

                if (isAvail)
                {
                    title = "Connected";
                    file = "Germz.Icon.ico";

                    iSceneManager.HideOverlay();
                }
                else
                {
                    title = "NO KINECT FOUND";
                    file = "Germz.NoKintec.Icon.ico";

                    iSceneManager.ShowOverlay(new KinectDisconnect());
                }

                Window.Title = string.Format("Germz | Dynamic Dorks [{0}]", title);
                var filename = string.Format("Res/{0}", file);
                ((SForms.Form)SForms.Form.FromHandle(Window.Handle)).Icon = new SDrawing.Icon(filename);
            });
            iKinect.OpenSensor();

            //Show Main menu
            iSceneManager.SetScene(new Entities.Scenes.GameInstance());
            colorRenderTarget = new RenderTarget2D(graphics.GraphicsDevice, 512, 424);

            //gestureRV = new GestureResultView(0, false, false, 0);
            //gestureDet = new GestureDetector(iKinect.iSensor, gestureRV);

            iKinect.OpenSensor();
            depthHeight = iKinect.iSensor.DepthFrameSource.FrameDescription.Height;
            depthWidth = iKinect.iSensor.DepthFrameSource.FrameDescription.Width;

            base.Initialize();
        }
Ejemplo n.º 8
0
 public override void HandleKeys(InputHelper aInputHelper, ISceneManager aSceneManager)
 {
     return;
 }