public Game(Canvas c) { //creates/resets the matrices and map MainWindow.gamestate = MainWindow.GameState.gameOn; matrix = new Matrices(); map = new Map(c); Matrices.removeBombs(); //construct player1 in top left corner player1Point = new Point(0, 0); player1 = new Player(c, new ImageBrush(new BitmapImage(new Uri("Sprites/Player2forward.png", UriKind.Relative))), player1Point, Key.W, Key.S, Key.A, Key.D, Key.LeftShift); //construct player2 in bottom right corner player2Point = new Point(896, 512); player2 = new Player(c, new ImageBrush(new BitmapImage(new Uri("Sprites/Player1forward.png", UriKind.Relative))), player2Point, Key.Up, Key.Down, Key.Left, Key.Right, Key.RightCtrl); }
/// <summary> /// Authors /// Sebastian Horton /// resets the fuse, updates the matrix and redraws the map. /// </summary> public bool resetBomb(bool bombPlaced) { if (bombFuse <= -2) { Matrices.updateBlocks(); Matrices.updateWalkable(); Matrices.removeBombs(); Map.colourMap(); return(bombPlaced = false); } else { return(bombPlaced = true); } }