Update: Custom Code - BK Flame - Before Render (dywmtohrda.js) 505 bytes modified
parent
22ae950b70
commit
4d131961bb
|
@ -48,6 +48,9 @@ if (
|
||||||
this.scene = GameLib.EntityManager.Instance.findComponentById('fd2be8y1c8');
|
this.scene = GameLib.EntityManager.Instance.findComponentById('fd2be8y1c8');
|
||||||
this.sceneCrosshair = GameLib.EntityManager.Instance.findComponentById('7xkcp6x9pf');
|
this.sceneCrosshair = GameLib.EntityManager.Instance.findComponentById('7xkcp6x9pf');
|
||||||
this.meshCrosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv');
|
this.meshCrosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv');
|
||||||
|
this.meshFireBall = GameLib.EntityManager.Instance.findComponentById('zmcwqlym5y');
|
||||||
|
|
||||||
|
this.flames = [];
|
||||||
|
|
||||||
for (var i = 0; i < 100; i++) {
|
for (var i = 0; i < 100; i++) {
|
||||||
var tree = this.tree.clone();
|
var tree = this.tree.clone();
|
||||||
|
@ -136,6 +139,13 @@ if (this.spawnTime > this.nextSpawnTime) {
|
||||||
this.spawnEnemy();
|
this.spawnEnemy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.flames.map(
|
||||||
|
function(flame) {
|
||||||
|
flame.mesh.position.add(flame.direction);
|
||||||
|
flame.mesh.updateInstancePosition();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
if (this.spawningBullets === true) {
|
if (this.spawningBullets === true) {
|
||||||
|
|
||||||
if (this.spawnBulletTime === 0) {
|
if (this.spawnBulletTime === 0) {
|
||||||
|
@ -153,11 +163,22 @@ if (this.spawningBullets === true) {
|
||||||
var start = new THREE.Vector3(0,0,0.5);
|
var start = new THREE.Vector3(0,0,0.5);
|
||||||
start.unproject(this.camera.instance);
|
start.unproject(this.camera.instance);
|
||||||
|
|
||||||
var end = direction.multiplyScalar(1000);
|
var end = direction.clone().multiplyScalar(1000);
|
||||||
|
|
||||||
console.log('start: ', start);
|
console.log('start: ', start);
|
||||||
console.log('end: ', end);
|
console.log('end: ', end);
|
||||||
|
|
||||||
|
var flameMesh = this.meshFireBall.clone();
|
||||||
|
flameMesh.position.x = start.x;
|
||||||
|
flameMesh.position.y = start.y;
|
||||||
|
flameMesh.position.z = start.z;
|
||||||
|
flameMesh.updateInstancePosition();
|
||||||
|
|
||||||
|
this.flames.push({
|
||||||
|
mesh : flameMesh,
|
||||||
|
direction: direction
|
||||||
|
});
|
||||||
|
|
||||||
var geometry = new THREE.Geometry();
|
var geometry = new THREE.Geometry();
|
||||||
geometry.vertices.push(
|
geometry.vertices.push(
|
||||||
start,
|
start,
|
||||||
|
|
Loading…
Reference in New Issue