Update: CC - Bacon - Entity Loaded (2xswm1bwq8.js) 155 bytes modified
parent
3bce4a9146
commit
613c38c65a
|
@ -1204,10 +1204,17 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
|
||||||
mesh3.visible = true;
|
mesh3.visible = true;
|
||||||
mesh3.updateInstance('visible');
|
mesh3.updateInstance('visible');
|
||||||
|
|
||||||
mesh0.setParentMesh(center);
|
mesh0.parentMesh = center;
|
||||||
mesh1.setParentMesh(center);
|
mesh0.updateInstance('parentMesh');
|
||||||
mesh2.setParentMesh(center);
|
|
||||||
mesh3.setParentMesh(center);
|
mesh1.parentMesh = center;
|
||||||
|
mesh1.updateInstance('parentMesh');
|
||||||
|
|
||||||
|
mesh2.parentMesh = center;
|
||||||
|
mesh2.updateInstance('parentMesh');
|
||||||
|
|
||||||
|
mesh3.parentMesh = center;
|
||||||
|
mesh3.updateInstance('parentMesh');
|
||||||
|
|
||||||
center.updateInstance('position');
|
center.updateInstance('position');
|
||||||
|
|
||||||
|
@ -1437,20 +1444,20 @@ GameLib.CustomCode.prototype.stopBlock = function() {
|
||||||
* If there already is a mesh - remove it -
|
* If there already is a mesh - remove it -
|
||||||
*/
|
*/
|
||||||
var block = this.grid[position.y][position.x];
|
var block = this.grid[position.y][position.x];
|
||||||
|
|
||||||
if (block.mesh) {
|
if (block.mesh) {
|
||||||
this.scene.removeObject(block.mesh);
|
this.scene.removeObject(block.mesh);
|
||||||
}
|
}
|
||||||
if (block.baconDisappearing) {
|
if (block.baconDisappearing) {
|
||||||
this.scene.removeObject(block.baconDisappearing);
|
this.scene.removeObject(block.baconDisappearing);
|
||||||
}
|
}
|
||||||
|
|
||||||
block = {
|
block = {
|
||||||
value : GameLib.CustomCode.TETRIS_GRID_TAKEN,
|
value : GameLib.CustomCode.TETRIS_GRID_TAKEN,
|
||||||
mesh : position.mesh,
|
mesh : position.mesh,
|
||||||
baconDisappearing : null
|
baconDisappearing : null
|
||||||
}
|
}
|
||||||
|
|
||||||
this.grid[position.y][position.x] = block;
|
this.grid[position.y][position.x] = block;
|
||||||
|
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
|
@ -1469,7 +1476,9 @@ GameLib.CustomCode.prototype.stopBlock = function() {
|
||||||
this.block.meshes.map(
|
this.block.meshes.map(
|
||||||
function (mesh) {
|
function (mesh) {
|
||||||
|
|
||||||
mesh.setParentMesh(null);
|
mesh.parentMesh = null;
|
||||||
|
mesh.updateInstance(parentMesh);
|
||||||
|
|
||||||
mesh.position.z = 2.5;
|
mesh.position.z = 2.5;
|
||||||
mesh.updateInstance('position');
|
mesh.updateInstance('position');
|
||||||
|
|
||||||
|
@ -1521,7 +1530,7 @@ GameLib.CustomCode.prototype.stopBlock = function() {
|
||||||
rows: this.rows
|
rows: this.rows
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue