From 613c38c65a407fcec495ee08a7d6d8eb93626be6 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Sun, 18 Feb 2018 16:53:08 +0100 Subject: [PATCH] Update: CC - Bacon - Entity Loaded (2xswm1bwq8.js) 155 bytes modified --- 2xswm1bwq8.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/2xswm1bwq8.js b/2xswm1bwq8.js index 7c94d1a..f2fd9c1 100644 --- a/2xswm1bwq8.js +++ b/2xswm1bwq8.js @@ -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 { /**