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"); } }
public override void LoadContent() { base.LoadContent(); XmlManager <Player> playerLoader = new XmlManager <Player>(); XmlManager <Player> playerwLoader = new XmlManager <Player>(); XmlManager <MovingTile> TileLoader = new XmlManager <MovingTile>(); XmlManager <Map> mapLoader = new XmlManager <Map>(); video = new VideoManager(); video.LoadContent(); playerb = playerLoader.Load("Load/Playerb.xml"); playerw = playerwLoader.Load("Load/Playerw.xml"); info = null; for (int x = 0; x < tileCount; x++) { blackTileList.Add(TileLoader.Load("Load/BlackTile.xml")); } for (int x = 0; x < tileCount; x++) { whiteTileList.Add(TileLoader.Load("Load/WhiteTile.xml")); } map = mapLoader.Load("Load/Map1.xml"); playerb.LoadContent(); playerw.LoadContent(); for (int x = 0; x < tileCount; x++) { blackTileList[x].LoadContent(); whiteTileList[x].LoadContent(); } map.LoadContent(); }