Update: CC - Bacon - Entity Loaded (2xswm1bwq8.js) 156 bytes modified

beta.r3js.org
-=yb4f310 2018-02-18 21:22:10 +01:00
parent b43ca7888d
commit 238dcf94a3
1 changed files with 18 additions and 10 deletions

View File

@ -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;