Update: CustomCode - Bacon - Entity Loaded (2xswm1bwq8.js) 5524 bytes modified

beta.r3js.org
-=yb4f310 2018-02-13 10:06:46 +01:00
parent 33fd548fe4
commit 0f1e547cdc
1 changed files with 1048 additions and 977 deletions

View File

@ -7,13 +7,15 @@ this.renderer = GameLib.EntityManager.Instance.findComponentById('nofv0eath8');
this.keyDown = GameLib.EntityManager.Instance.findComponentById('dgscoensvf');
this.touchStart = GameLib.EntityManager.Instance.findComponentById('xjaoh824ff');
this.touchEnd = GameLib.EntityManager.Instance.findComponentById('ohqwmnjfgf');
this.box2 = GameLib.EntityManager.Instance.findComponentById('aweuo7dfry');
this.image7 = GameLib.EntityManager.Instance.findComponentById('d8kfivrbou');
this.image10 = GameLib.EntityManager.Instance.findComponentById('7uwrr1c1fq');
this.image11 = GameLib.EntityManager.Instance.findComponentById('bzhit3u165');
this.image13 = GameLib.EntityManager.Instance.findComponentById('gezkqe66ye');
this.image14 = GameLib.EntityManager.Instance.findComponentById('n5puf21gex');
this.image15 = GameLib.EntityManager.Instance.findComponentById('yx5u4ribb5');
this.image_0 = GameLib.EntityManager.Instance.findComponentById('gvrik6h4yd');
this.image_1 = GameLib.EntityManager.Instance.findComponentById('ssdlmrpv9j');
this.image_2 = GameLib.EntityManager.Instance.findComponentById('zdg2qpu35c');
this.image_3 = GameLib.EntityManager.Instance.findComponentById('pjy42fg69n');
this.image_4 = GameLib.EntityManager.Instance.findComponentById('5t3olr10pw');
this.image_5 = GameLib.EntityManager.Instance.findComponentById('qrh0foyins');
this.image_6 = GameLib.EntityManager.Instance.findComponentById('0bjbsj4sss');
this.boxCenter = GameLib.EntityManager.Instance.findComponentById('nazmn9boih');
this.animation = GameLib.EntityManager.Instance.findComponentById('tnlwgvf12x');
this.canvas = GameLib.EntityManager.Instance.findComponentById('85d0jk6dhx');
@ -922,22 +924,22 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
if (blockType === GameLib.CustomCode.TETRIS_BLOCK_I) {
mesh0 = this.box11.clone();
mesh0 = this.tile_4.clone();
mesh0.position.setFrom(center.position);
mesh0.position.z = -0.1;
mesh0.position.x -= 1;
mesh1 = this.box13.clone();
mesh1 = this.tile_5.clone();
mesh1.position.setFrom(center.position);
mesh1.position.z = -0.1;
mesh1.position.x -= 2;
mesh2 = this.box14.clone();
mesh2 = this.tile_6.clone();
mesh2.position.setFrom(center.position);
mesh2.position.z = -0.1;
mesh2.position.x += 0;
mesh3 = this.box15.clone();
mesh3 = this.tile_2.clone();
mesh3.position.setFrom(center.position);
mesh3.position.z = -0.1;
mesh3.position.x += 1;
@ -953,23 +955,23 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
}
if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L) {
mesh0 = this.box14.clone();
mesh0 = this.tile_6.clone();
mesh0.position.setFrom(center.position);
mesh0.position.z = -0.1;
mesh0.position.x += 1;
mesh0.position.y += 1;
mesh1 = this.box11.clone();
mesh1 = this.tile_4.clone();
mesh1.position.setFrom(center.position);
mesh1.position.z = -0.1;
mesh1.position.x += 1;
mesh2 = this.box14.clone();
mesh2 = this.tile_6.clone();
mesh2.position.setFrom(center.position);
mesh2.position.z = -0.1;
mesh2.position.x += 0;
mesh3 = this.box15.clone();
mesh3 = this.tile_2.clone();
mesh3.position.setFrom(center.position);
mesh3.position.z = -0.1;
mesh3.position.x -= 1;
@ -985,23 +987,23 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
}
if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L2) {
mesh0 = this.box14.clone();
mesh0 = this.tile_6.clone();
mesh0.position.setFrom(center.position);
mesh0.position.z = -0.1;
mesh0.position.x -= 1;
mesh0.position.y += 1;
mesh1 = this.box11.clone();
mesh1 = this.tile_4.clone();
mesh1.position.setFrom(center.position);
mesh1.position.z = -0.1;
mesh1.position.x += 1;
mesh2 = this.box14.clone();
mesh2 = this.tile_6.clone();
mesh2.position.setFrom(center.position);
mesh2.position.z = -0.1;
mesh2.position.x += 0;
mesh3 = this.box15.clone();
mesh3 = this.tile_2.clone();
mesh3.position.setFrom(center.position);
mesh3.position.z = -0.1;
mesh3.position.x -= 1;
@ -1017,22 +1019,22 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
}
if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z) {
mesh0 = this.box10.clone();
mesh0 = this.tile_3.clone();
mesh0.position.setFrom(center.position);
mesh0.position.z = -0.1;
mesh0.position.y += 1;
mesh1 = this.box11.clone();
mesh1 = this.tile_4.clone();
mesh1.position.setFrom(center.position);
mesh1.position.z = -0.1;
mesh1.position.x -= 1;
mesh1.position.y += 1;
mesh2 = this.box15.clone();
mesh2 = this.tile_2.clone();
mesh2.position.setFrom(center.position);
mesh2.position.z = -0.1;
mesh3 = this.box7.clone();
mesh3 = this.tile_1.clone();
mesh3.position.setFrom(center.position);
mesh3.position.z = -0.1;
mesh3.position.x += 1;
@ -1049,22 +1051,22 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z2) {
mesh0 = this.box10.clone();
mesh0 = this.tile_3.clone();
mesh0.position.setFrom(center.position);
mesh0.position.z = -0.1;
mesh0.position.y += 1;
mesh1 = this.box11.clone();
mesh1 = this.tile_4.clone();
mesh1.position.setFrom(center.position);
mesh1.position.z = -0.1;
mesh1.position.x += 1;
mesh1.position.y += 1;
mesh2 = this.box15.clone();
mesh2 = this.tile_2.clone();
mesh2.position.setFrom(center.position);
mesh2.position.z = -0.1;
mesh3 = this.box7.clone();
mesh3 = this.tile_1.clone();
mesh3.position.setFrom(center.position);
mesh3.position.z = -0.1;
mesh3.position.x -= 1;
@ -1080,21 +1082,21 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
}
if (blockType === GameLib.CustomCode.TETRIS_BLOCK_T) {
mesh0 = this.box14.clone();
mesh0 = this.tile_6.clone();
mesh0.position.setFrom(center.position);
mesh0.position.z = -0.1;
mesh0.position.y -= 1;
mesh1 = this.box13.clone();
mesh1 = this.tile_5.clone();
mesh1.position.setFrom(center.position);
mesh1.position.z = -0.1;
mesh2 = this.box11.clone();
mesh2 = this.tile_4.clone();
mesh2.position.setFrom(center.position);
mesh2.position.z = -0.1;
mesh2.position.x -= 1;
mesh3 = this.box15.clone();
mesh3 = this.tile_2.clone();
mesh3.position.setFrom(center.position);
mesh3.position.z = -0.1;
mesh3.position.x += 1;
@ -1110,25 +1112,25 @@ GameLib.CustomCode.prototype.spawnBlock = function () {
}
if (blockType === GameLib.CustomCode.TETRIS_BLOCK_O) {
mesh0 = this.box10.clone();
mesh0 = this.tile_3.clone();
mesh0.position.setFrom(center.position);
mesh0.position.z = -0.1;
mesh0.position.y += 0.5;
mesh0.position.x += 0.5;
mesh1 = this.box2.clone();
mesh1 = this.tile_0.clone();
mesh1.position.setFrom(center.position);
mesh1.position.z = -0.1;
mesh1.position.y += 0.5;
mesh1.position.x -= 0.5;
mesh2 = this.box13.clone();
mesh2 = this.tile_5.clone();
mesh2.position.setFrom(center.position);
mesh2.position.z = -0.1;
mesh2.position.y -= 0.5;
mesh2.position.x -= 0.5;
mesh3 = this.box15.clone();
mesh3 = this.tile_2.clone();
mesh3.position.setFrom(center.position);
mesh3.position.z = -0.1;
mesh3.position.y -= 0.5;
@ -1340,6 +1342,75 @@ if (GameLib.Utils.UndefinedOrNull(this.subscriptions)) {
);
}
GameLib.Event.Emit(GameLib.Event.GAME_LOADED);
GameLib.CustomCode.prototype.createTile = function(tileName, imageName) {
this[tileName] = new GameLib.D3.Mesh(
this.graphics,
new GameLib.D3.API.Mesh(
null,
null,
null,
this.parentEntity,
new GameLib.D3.API.Geometry.Buffer.Plane(
new GameLib.D3.API.Geometry(
null,
null,
null,
this.parentEntity
)
),
[
new GameLib.D3.API.Material.Phong(
new GameLib.D3.API.Material(
null,
null,
null,
this.parentEntity
),
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
null,
new GameLib.D3.API.Texture.Image(
null,
this[imageName]
)
)
]
)
)
}.bind(this);
GameLib.Event.Emit(
GameLib.Event.GET_RUNTIME,
function(runtime) {
this.graphics = runtime.graphics;
this.createTile('tile_0', 'image_0');
this.createTile('tile_1', 'image_1');
this.createTile('tile_2', 'image_2');
this.createTile('tile_3', 'image_3');
this.createTile('tile_4', 'image_4');
this.createTile('tile_5', 'image_5');
this.createTile('tile_6', 'image_6');
GameLib.Event.Emit(GameLib.Event.GAME_LOADED);
}.bind(this)
)
//@ sourceURL=entityLoaded.js