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

beta.r3js.org
-=yb4f310 2018-02-18 16:53:08 +01:00
parent 3bce4a9146
commit 613c38c65a
1 changed files with 18 additions and 9 deletions

View File

@ -1204,10 +1204,17 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
mesh3.visible = true;
mesh3.updateInstance('visible');
mesh0.setParentMesh(center);
mesh1.setParentMesh(center);
mesh2.setParentMesh(center);
mesh3.setParentMesh(center);
mesh0.parentMesh = center;
mesh0.updateInstance('parentMesh');
mesh1.parentMesh = center;
mesh1.updateInstance('parentMesh');
mesh2.parentMesh = center;
mesh2.updateInstance('parentMesh');
mesh3.parentMesh = center;
mesh3.updateInstance('parentMesh');
center.updateInstance('position');
@ -1437,20 +1444,20 @@ GameLib.CustomCode.prototype.stopBlock = function() {
* If there already is a mesh - remove it -
*/
var block = this.grid[position.y][position.x];
if (block.mesh) {
this.scene.removeObject(block.mesh);
}
if (block.baconDisappearing) {
this.scene.removeObject(block.baconDisappearing);
}
block = {
value : GameLib.CustomCode.TETRIS_GRID_TAKEN,
mesh : position.mesh,
baconDisappearing : null
}
this.grid[position.y][position.x] = block;
}.bind(this)
@ -1469,7 +1476,9 @@ GameLib.CustomCode.prototype.stopBlock = function() {
this.block.meshes.map(
function (mesh) {
mesh.setParentMesh(null);
mesh.parentMesh = null;
mesh.updateInstance(parentMesh);
mesh.position.z = 2.5;
mesh.updateInstance('position');
@ -1521,7 +1530,7 @@ GameLib.CustomCode.prototype.stopBlock = function() {
rows: this.rows
}
);
} else {
/**