Update: CC - Bacon - Entity Loaded (2xswm1bwq8.js) 248 bytes modified
parent
501feb846e
commit
ef40661661
|
@ -43,7 +43,7 @@ this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('kva68t4dm8
|
|||
* Animations
|
||||
*/
|
||||
this.animation = GameLib.EntityManager.Instance.findComponentById('tnlwgvf12x');
|
||||
this.animationSystem = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.SYSTEM_ANIMATION)[0];
|
||||
//this.animationSystem = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.SYSTEM_ANIMATION)[0];
|
||||
|
||||
/**
|
||||
* Lights
|
||||
|
@ -822,9 +822,10 @@ GameLib.CustomCode.prototype.rotateBlock = function (clockwise) {
|
|||
var targetRotation = this.block.center.rotation.z + Math.PI / 2;
|
||||
}
|
||||
|
||||
this.animationSystem.stop();
|
||||
|
||||
var originalRotation = this.block.center.rotation.z;
|
||||
var rotationBackup = {
|
||||
instance : this.block.center.instance.rotation.z,
|
||||
object : this.block.center.rotation.z
|
||||
}
|
||||
|
||||
this.block.center.rotation.z = targetRotation;
|
||||
this.block.center.updateInstance('rotation');
|
||||
|
@ -833,20 +834,27 @@ GameLib.CustomCode.prototype.rotateBlock = function (clockwise) {
|
|||
|
||||
if (boundaries.collision) {
|
||||
|
||||
this.block.center.rotation.z = originalRotation;
|
||||
this.block.center.updateInstance('rotation');
|
||||
/**
|
||||
* There's a collision, restore the instance rotation
|
||||
*/
|
||||
this.block.center.instance.rotation.z = rotationBackup.instance;
|
||||
|
||||
this.animationSystem.start();
|
||||
/**
|
||||
* And also the object rotation
|
||||
*/
|
||||
this.block.center.rotation.z = rotationBackup.object;
|
||||
|
||||
} else {
|
||||
|
||||
this.block.center.rotation.z = originalRotation;
|
||||
|
||||
this.animationSystem.start();
|
||||
/**
|
||||
* Restore our instance rotation
|
||||
*/
|
||||
this.block.center.instance.rotation.z = rotationBackup.instance;
|
||||
|
||||
/**
|
||||
* Update our object to the new rotation
|
||||
*/
|
||||
this.block.center.rotation.z = targetRotation;
|
||||
this.block.center.updateInstance('rotation');
|
||||
|
||||
}
|
||||
|
||||
}.bind(this);
|
||||
|
@ -1307,7 +1315,7 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () {
|
|||
|
||||
GameLib.CustomCode.prototype.getNextBlock = function () {
|
||||
|
||||
this.animationSystem.stop();
|
||||
// this.animationSystem.stop();
|
||||
|
||||
this.block = this.spawnBigBlock();
|
||||
|
||||
|
@ -1318,7 +1326,7 @@ GameLib.CustomCode.prototype.getNextBlock = function () {
|
|||
}
|
||||
);
|
||||
|
||||
this.animationSystem.start();
|
||||
// this.animationSystem.start();
|
||||
|
||||
this.animation.meshes.push(this.block.center);
|
||||
|
||||
|
|
Loading…
Reference in New Issue