src/game/levels/generators/TilesGenerator.js
/**
     * Disposes old tiles and obstacles (last 20 unused tiles and their obstacles)
     */
Disposes old tiles and obstacles (last 20 unused tiles and their obstacles)
Disposes old tiles and obstacles ( last 20 unused tiles and their obstacles )
disposeOldTiles() {
        let lastTilesBlock = this.generatedTilesBlocksNumber - 1,
            tilesBlocks = this.scene.getMeshesByTags('tilesBlock' + lastTilesBlock);
        for(var index = 0; index < tilesBlocks.length; index++) {
            tilesBlocks[index].dispose();
        }
    }
disposeOldTiles ( ) { let lastTilesBlock = this . generatedTilesBlocksNumber - 1 , tilesBlocks = this . scene . getMeshesByTags ( 'tilesBlock' + lastTilesBlock ) ; for ( var index = 0 ; index < tilesBlocks . length ; index ++ ) { tilesBlocks [ index ] . dispose ( ) ; } }
Disposes old tiles and obstacles (last 20 unused tiles and their obstacles)
Disposes old tiles and obstacles ( last 20 unused tiles and their obstacles )