initial wall sound effect
This commit is contained in:
@@ -9,21 +9,23 @@ AFRAME.registerComponent('wall', {
|
||||
|
||||
pause: function () {
|
||||
this.el.object3D.visible = false;
|
||||
this.el.removeAttribute('collidable');
|
||||
},
|
||||
|
||||
play: function () {
|
||||
this.el.object3D.visible = true;
|
||||
this.el.setAttribute('collidable', '');
|
||||
},
|
||||
|
||||
tock: function (time, delta) {
|
||||
this.el.object3D.position.z += this.data.speed * (delta / 1000);
|
||||
this.returnToPool();
|
||||
if (this.el.object3D.position.z > this.maxZ) { this.returnToPool(); }
|
||||
},
|
||||
|
||||
returnToPool: function () {
|
||||
if (this.el.object3D.position.z < this.maxZ) { return; }
|
||||
this.el.sceneEl.components.pool__wall.returnEntity(this.el);
|
||||
this.el.object3D.position.z = 9999;
|
||||
this.el.pause();
|
||||
this.el.removeAttribute('collidable');
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user