Search Unity

Match 3 Game Blank Spaces Moving To Random Locations

Discussion in '2D' started by Developer_Randy, Oct 2, 2019.

  1. Developer_Randy

    Developer_Randy

    Joined:
    Sep 2, 2019
    Posts:
    3
    This is whenever I start the game, so this image shows the game with the blank spaces at the locations I assigned them to, so that's good.
    upload_2019-10-2_9-33-13.png

    This is after I make a match. The blank spots I made are now filled up and blank spots appear at random locations on the board.
    upload_2019-10-2_9-34-22.png

    What could be the cause of this?
     

    Attached Files:

  2. Developer_Randy

    Developer_Randy

    Joined:
    Sep 2, 2019
    Posts:
    3
    Here is my code
     

    Attached Files:

  3. SmokeyShadow

    SmokeyShadow

    Joined:
    Mar 27, 2017
    Posts:
    1
    Hello there ,
    if you dont want to refill the empty spaces you have to delete all refrences codes to (FillBoardCo function in board script)
    the function I've attached below:
    Code (CSharp):
    1. //delete all refrences to this function
    2.     private IEnumerator FillBoardCo(){
    3.         RefillBoard();
    4.         yield return new WaitForSeconds(.5f);
    5.  
    6.         while (MatchesOnBoard()){
    7.             yield return new WaitForSeconds(.5f);
    8.             DestroyMatches();
    9.         }
    10.         findMatches.currentMatches.Clear();
    11.         currentDot = null;
    12.         yield return new WaitForSeconds(.5f);
    13.         currentState = GameState.move;
    14.  
    15.     }
    16.  
     
  4. Developer_Randy

    Developer_Randy

    Joined:
    Sep 2, 2019
    Posts:
    3
    Hello, thanks for the response.
    Whenever I make a match I DO want the board to fill up again(to have the possibility to make new matches), but just not in the blank spaces I made.