예제 #1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
            if (Global.gKeyboardHelper.IsKeyPressed(Keys.Escape))
            {
                Global.gViewState = ViewState.PausedView;
            }
            map.Update(gameTime);
            characters.Update(gameTime);
            List <Vector4> distances = map.GetDistances(this.characters.BoundingBoxes);

            this.characters.SetDistances(distances);
            catHead.Update(gameTime);
            dogHead.Update(gameTime);

            score           = characters.ListCharacters[0].Point.ToString() + " : " + characters.ListCharacters[1].Point.ToString();
            positionScore   = (1280 - Global.gDefaultMediumFont.MeasureString(score).X) / 2;
            positionCatHead = positionScore - catHead.Width - 10;
            positionDogHead = positionScore + Global.gDefaultMediumFont.MeasureString(score).X + 10;
            pause.Update(gameTime);

            foreach (Character c in characters.ListCharacters)
            {
                if (c.Point == Global.gKillLimit)
                {
                    Global.gViewState = ViewState.GameOverView;
                    Global.gWinner    = c.GetType().Name.ToString();
                }
            }
        }
예제 #2
0
 public override void Update(GameTime gameTime)
 {
     base.Update(gameTime);
     background.Update(gameTime);
     foreach (Button button in buttons)
     {
         button.Update(gameTime);
     }
 }
예제 #3
0
 public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
 {
     base.Update(gameTime);
     logo.Update(gameTime);
 }