Example #1
0
        protected override void Update(GameTime gameTime)
        {
            TouchCollection touchCollection = TouchPanel.GetState();

            if (hero != null)
            {
                hero.Update(touchCollection);
            }

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                Exit();
            }
            camera.Update(hero);
            resolutionManager.Update();
            base.Update(gameTime);

            checkCollition();

            if (drawCooler > 0)
            {
                drawCooler--;
            }
            if (drawCooler < 0)
            {
                drawCooler = 0;
            }
        }
Example #2
0
 public int checkTouch(TouchCollection touchCollection)
 {
     res.Update();
     if (touchCollection.Count > 0 && touchCollection[0].State == TouchLocationState.Pressed)
     {
         return(1);
     }
     return(0);
 }