diff --git a/2xswm1bwq8.js b/2xswm1bwq8.js index 74445c2..765ef6a 100644 --- a/2xswm1bwq8.js +++ b/2xswm1bwq8.js @@ -32,7 +32,7 @@ this.scene = GameLib.EntityManager.Instance.findComponentById('i1ac678a5d'); /** * Materials */ -this.gridMaterial = GameLib.EntityManager.Instance.findComponentById('xpkbcvson9'); +this.gridMaterial = GameLib.EntityManager.Instance.findComponentById('1tp9zqjo6s'); /** * Score @@ -584,21 +584,27 @@ GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { }.bind(this); GameLib.CustomCode.prototype.drawGrid = function () { + + var geometry = new THREE.PlaneBufferGeometry(); - var geometry = new THREE.BufferGeometry(); - - var points = []; + var mesh = new THREE.Mesh( + geometry, + this.gridMaterial.instance + ); for (var y = 0; y < (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE); y++) { for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { - points.push(x, y, 2); + + var clone = mesh.clone(); + + clone.position.x = x; + clone.position.y = y; + clone.position.z = 2; + + this.scene.instance.add(clone); } } - - geometry.addAttribute('position', new THREE.Float32BufferAttribute(points, 3)); - - this.scene.instance.add(new THREE.Points(geometry, this.gridMaterial.instance)); - + geometry = new THREE.Geometry(); geometry.vertices.push( @@ -1658,6 +1664,8 @@ GameLib.Event.Emit( this.createTile('tile_5', 'image_5', true); this.createTile('tile_6', 'image_6', true); + this.createTile('tile_grid', 'image_grid'); + this.createTile('tile_flames_small', 'image_flames_small'); this.tile_flames_small.materials[0].transparent = true;