fillWithRandomDots() {
    // reset colorBuckets
    //Alexandr + 16/03/2021 - recreating scene anims
//    this.scene.anims.destroy(this.scene.cfgbonus1);   
//    this.scene.anims.destroy(this.scene.cfgbonus2);   
//    this.scene.anims.destroy(this.scene.cfgbonus3);  
//      
//    this.scene.anims.create(this.scene.cfgbonus1);   
//    this.scene.anims.create(this.scene.cfgbonus2);   
//    this.scene.anims.create(this.scene.cfgbonus3);     
    //Alexandr - 16/03/2021  
    this.colorBuckets = new Array(this.numColors);
    for (let i = 0; i < this.colorBuckets.length; i++) {
      this.colorBuckets[i] = [];
    }
    // remove old dots and replace with a new dot with random color
    this.grid.forEach((row, r) => {
      row.forEach((cell, c) => {
        if (cell.dot !== null) {
           
          //Alexanndr + 16/03/2021 - removing old animations      
          if(cell.dot.bonusFeature>0){
             cell.dot.bonusFeature = 0;   
             //console.log("bonus " + cell.dot.bonusFeature); 
             cell.dot.anims.stop();  
             cell.dot.anims.remove(this.scene.anims.get('explode'+cell.dot.bonusFeature)); 
             cell.dot.setTexture("dot");
            // console.log(cell.dot);  
          };   
          //Alexanndr - 16/03/2021 
            
          this.dotGroup.killAndHide(cell.dot);
          cell.dot = null;
        }
        let dot = this.addNewDot(cell.x, cell.y);
        dot.setGridPosition(r, c);
        this.grid[r][c].dot = dot;
      });
    });
  }
// Add a new randomized dot to every cell in the grid, removing old dots.
Add a new randomized dot to every cell in the grid, removing old dots.
Add a new randomized dot to every cell in the grid removing old dots .
fillWithRandomDots() {
    this.colorBuckets = new Array(this.numColors);
    for (let i = 0; i < this.colorBuckets.length; i++) {
      this.colorBuckets[i] = [];
    }
    this.grid.forEach((row, r) => {
      row.forEach((cell, c) => {
        if (cell.dot !== null) {
          if(cell.dot.bonusFeature>0){
             cell.dot.bonusFeature = 0;   
             cell.dot.anims.stop();  
             cell.dot.anims.remove(this.scene.anims.get('explode'+cell.dot.bonusFeature)); 
             cell.dot.setTexture("dot");
          };   
          this.dotGroup.killAndHide(cell.dot);
          cell.dot = null;
        }
        let dot = this.addNewDot(cell.x, cell.y);
        dot.setGridPosition(r, c);
        this.grid[r][c].dot = dot;
      });
    });
  }
fillWithRandomDots ( ) { this . colorBuckets = new Array ( this . numColors ) ; for ( let i = 0 ; i < this . colorBuckets . length ; i ++ ) { this . colorBuckets [ i ] = [ ] ; } this . grid . forEach ( ( row , r ) => { row . forEach ( ( cell , c ) => { if ( cell . dot !== null ) { if ( cell . dot . bonusFeature > 0 ) { cell . dot . bonusFeature = 0 ; cell . dot . anims . stop ( ) ; cell . dot . anims . remove ( this . scene . anims . get ( 'explode' + cell . dot . bonusFeature ) ) ; cell . dot . setTexture ( "dot" ) ; } ; this . dotGroup . killAndHide ( cell . dot ) ; cell . dot = null ; } let dot = this . addNewDot ( cell . x , cell . y ) ; dot . setGridPosition ( r , c ) ; this . grid [ r ] [ c ] . dot = dot ; } ) ; } ) ; }
Add a new randomized dot to every cell in the grid, removing old dots.
Add a new randomized dot to every cell in the grid removing old dots .
// reset colorBuckets //Alexandr + 16/03/2021 - recreating scene anims //    this.scene.anims.destroy(this.scene.cfgbonus1);    //    this.scene.anims.destroy(this.scene.cfgbonus2);    //    this.scene.anims.destroy(this.scene.cfgbonus3);   //       //    this.scene.anims.create(this.scene.cfgbonus1);    //    this.scene.anims.create(this.scene.cfgbonus2);    //    this.scene.anims.create(this.scene.cfgbonus3);      //Alexandr - 16/03/2021   // remove old dots and replace with a new dot with random color //Alexanndr + 16/03/2021 - removing old animations       //console.log("bonus " + cell.dot.bonusFeature);  // console.log(cell.dot);   //Alexanndr - 16/03/2021 