11/12/2022 0 Comments Minesweeper patterns![]()
Var top = System.height - this.rows*cellSide Var left = (System.width - 9*cellSide) / 2 + cellSide / 2 The table is created by two for loops - one for rows and one for columns. Mines are randomly distributed across the table with nine rows and nine columns. Game scene creates table of mines, mine counter, timer and menu. } else // inform game scene that cell without mine was uncovered inform game scene that mine was uncovered if _state is _state_MINE we found mine if _state is 0 we need to uncover larger area (all 0 in surounding cells). To inform game scene that cell was uncovered we used open function. However, it is needed to let know for game scene purposes that cell was uncovered to f.e.: start explosion of all mines if user found the mine or to uncover more cells, if user found the cell without mines in neighbour cells. Pointer released is called inside the object of MineCell class. In that case, a cell is unmarked or uncovered. If this event is called before the timer, started in pointer pressed, ends, it means that user taps on the cell for less than 400 ms (short tap). do nothing if user press uncovered cell or game is paused After 400 ms the cell is marked or unmarked. When user taps on some cell the timer starts to check the cell for a long press.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |