Exemple #1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            video.Update(gameTime);

            pbLoc = playerb.Image.Position;
            pwLoc = playerw.Image.Position;

            if (!playerw.dead)
            {
                playerb.Update(gameTime, pbLoc, pwLoc);
            }
            else
            {
                if (info == null)
                {
                    info = infoLoader.Load("Load/WhiteWin.xml");
                    info.LoadContent();
                }
                else
                {
                    info.Update(gameTime);
                }
            }

            if (!playerb.dead)
            {
                playerw.Update(gameTime, pbLoc, pwLoc);
            }
            else
            {
                if (info == null)
                {
                    info = infoLoader.Load("Load/BlackWin.xml");
                    info.LoadContent();
                }
                else
                {
                    info.Update(gameTime);
                }
            }

            for (int x = 0; x < tileCount; x++)
            {
                blackTileList[x].Update(gameTime);
                whiteTileList[x].Update(gameTime);
            }

            map.Update(gameTime, ref playerb);
            map.Update(gameTime, ref playerw);


            if (InputManager.Instance.KeyPressed(Keys.Back) || InputManager.Instance.KeyPressed(Keys.Enter) || InputManager.Instance.KeyPressed(Keys.Q))
            {
                video.stopVideo();
                ScreenManager.Instance.ChangeScreens("TitleScreen");
            }
        }