private void Start() { target = GameObject.Find("Player").transform; rb = GetComponent <Rigidbody>(); coll = GetComponent <Collider>(); grid = FindObjectOfType <Gridy>(); stopwatch.Start(); FindPath(); StartCoroutine(UpdatePath()); }
//asserts that a new grid is created and is not null public void CreateNewGrid() { int mine = 0; bool flag = false; bool hide = true; int rowCount = 5; int columnCount = 5; Block block1 = new Block(mine, flag, hide); Gridy grid = new Gridy(block1, rowCount, columnCount); Assert.IsNotNull(grid); }
//creates a new blcok, and a grid out of blocks public void NewGame() { Minesweeper.Block blocky = new Minesweeper.Block(0, false, true); //make a grid with bombs and the numbers gridy = new Gridy(blocky, MyVariables.row, MyVariables.column); gridy.MineIt(MyVariables.mine); gridy.NumberIt(); gridy.RemainingBombsCount(); stopWatch.Start(); dt.Start(); }
//creates two blocks and asserts they are different objects public void AssertTwoObjects() { int mine = 0; bool flag = false; bool hide = true; int row = 5; int column = 7; Block block1 = new Block(mine, flag, hide); Gridy grid1 = new Gridy(block1, row, column); Gridy grid2 = new Gridy(block1, row, column); Assert.AreNotSame(grid1, grid2); }
//Creates a grid, selects a position and verifies the Mine value is not 9, // then mines the whole grid and verified the same position Mine value is 9 public void AssertMines() { int mine = 0; bool flag = false; bool hide = true; int row = 2; int column = 2; int mines = 4; Block block1 = new Block(mine, flag, hide); Gridy grid1 = new Gridy(block1, row, column); Assert.AreNotEqual(9, grid1.theGrid[0, 0].Mine); grid1.MineIt(mines); Assert.AreEqual(9, grid1.theGrid[0, 0].Mine); }
//creates a grid, adds 2 mines and verifies the adjacent cells have the values // that represent the adjacent mines count public void AssertAdjacentMineNumberIt() { int mine = 0; bool flag = false; bool hide = true; int row = 3; int column = 3; Block block1 = new Block(mine, flag, hide); Gridy grid1 = new Gridy(block1, row, column); grid1.theGrid[0, 0].Mine = 9; grid1.theGrid[1, 1].Mine = 9; grid1.NumberIt(); Assert.AreEqual(grid1.theGrid[0, 1].Mine, 2); Assert.AreEqual(grid1.theGrid[1, 2].Mine, 1); Assert.AreEqual(grid1.theGrid[0, 3].Mine, 0); }
void Awake() { requsetManager = GetComponent <PathRequestManager>(); grid = GetComponent <Gridy>(); }
public AudioClip[] bgmList = new AudioClip[2]; //babysteps, groovy #endregion // Reference: https://www.youtube.com/watch?v=VBZFYGWvm4A void Awake() { // Find Grid In Scene grid = FindObjectOfType <Gridy>(); }
void Awake() { grid = GetComponent <Gridy>(); }