@@ -17,6 +17,14 @@ Thus, due to time limitation, the code was suited to keep the opening of surroun
...
@@ -17,6 +17,14 @@ Thus, due to time limitation, the code was suited to keep the opening of surroun
## Good Code
## Good Code
According to me, the good code section can be considered the game logic section. It was quite time consuming to come up with a logic that could enable the game logic part of displaying numbers as I wanted to create an idea different from the past minesweeper approaches. The earlier minesweeper versions, as per a bit of research, used probability to allocate mines and then considering the 2D aspect of the tiles, the sprites would be used to calculate the location and subsequently go through the number allocation.
Our game of MACSmine, however, was being built as a 3D system. Thus, there was usage of 3 dimensional coordinates to create the whole structure. This meant that the complexity of the algorithm would take a hit if the calculations are too vast. Thus, I decided to reduce the implementation difficulty by trying to change the whole distribution from 2 dimensional array to one dimensional array to reduce the time a bit. Now, executing such a logic was difficult considering the difference in whole structure with the removal of probabilistic effect. So, i decided to divide the whole layering scheme into 3 primary groups:
- MineTile : This tile gameobject was used to represent the mine tile. The calculations for the minetile was done using the 3 separate sections of neighbouring tile logic. The prefabs were built in Unity which were being invoked into the code and a tile was placed based on a random selection of mine locations in the one dimensional array.