Update: CC - Snake FS - Mouse Down (gzewp2awcf.js) 823 bytes modified

beta.r3js.org
-=yb4f310 2018-03-25 11:17:34 +02:00
parent a6d6443618
commit dbd977ad92
1 changed files with 33 additions and 4 deletions

View File

@ -41,11 +41,12 @@ intersects.map(
var pixel = intersect.mesh.materials[0].diffuseMap.image.alphas[(256 * y) + x]; var pixel = intersect.mesh.materials[0].diffuseMap.image.alphas[(256 * y) + x];
if (pixel > 0) { if (pixel > 0) {
intersect.mesh.materials[0].visible = true;
intersect.mesh.materials[0].updateInstance('visible');
if (intersect.mesh.id === 'e69gb1028e') { if (intersect.mesh.id === 'e69gb1028e') {
intersect.mesh.materials[0].visible = true;
intersect.mesh.materials[0].updateInstance('visible');
GameLib.Event.Emit( GameLib.Event.Emit(
GameLib.Event.KEY_DOWN, GameLib.Event.KEY_DOWN,
{ {
@ -55,6 +56,10 @@ intersects.map(
} }
if (intersect.mesh.id === 'z0gwmplslj') { if (intersect.mesh.id === 'z0gwmplslj') {
intersect.mesh.materials[0].visible = true;
intersect.mesh.materials[0].updateInstance('visible');
GameLib.Event.Emit( GameLib.Event.Emit(
GameLib.Event.KEY_DOWN, GameLib.Event.KEY_DOWN,
{ {
@ -64,6 +69,10 @@ intersects.map(
} }
if (intersect.mesh.id === 'q3ra6x84d8') { if (intersect.mesh.id === 'q3ra6x84d8') {
intersect.mesh.materials[0].visible = true;
intersect.mesh.materials[0].updateInstance('visible');
GameLib.Event.Emit( GameLib.Event.Emit(
GameLib.Event.KEY_DOWN, GameLib.Event.KEY_DOWN,
{ {
@ -73,6 +82,10 @@ intersects.map(
} }
if (intersect.mesh.id === '2eva6brga6') { if (intersect.mesh.id === '2eva6brga6') {
intersect.mesh.materials[0].visible = true;
intersect.mesh.materials[0].updateInstance('visible');
GameLib.Event.Emit( GameLib.Event.Emit(
GameLib.Event.KEY_DOWN, GameLib.Event.KEY_DOWN,
{ {
@ -85,8 +98,16 @@ intersects.map(
this.state.paused = !this.state.paused; this.state.paused = !this.state.paused;
if (this.state.paused) { if (this.state.paused) {
intersect.mesh.materials[0].visible = true;
intersect.mesh.materials[0].updateInstance('visible');
GameLib.Event.Emit(GameLib.Event.PAUSE_ALL_AUDIO); GameLib.Event.Emit(GameLib.Event.PAUSE_ALL_AUDIO);
} else { } else {
intersect.mesh.materials[0].visible = false;
intersect.mesh.materials[0].updateInstance('visible');
GameLib.Event.Emit(GameLib.Event.CONTINUE_ALL_AUDIO); GameLib.Event.Emit(GameLib.Event.CONTINUE_ALL_AUDIO);
} }
@ -97,6 +118,14 @@ intersects.map(
this.state.muted = !this.state.muted; this.state.muted = !this.state.muted;
GameLib.Event.Emit(GameLib.Event.MUTE_AUDIO); GameLib.Event.Emit(GameLib.Event.MUTE_AUDIO);
if (this.state.muted) {
intersect.mesh.materials[0].visible = true;
intersect.mesh.materials[0].updateInstance('visible');
} else {
intersect.mesh.materials[0].visible = false;
intersect.mesh.materials[0].updateInstance('visible');
}
} }
} }