Update: CC - Before Render - Moorcow (9l6o7974qx.js) 51 bytes modified
parent
a2eddc4096
commit
3669778baa
|
@ -46,36 +46,38 @@ if (
|
|||
|
||||
var position = {x : 0, y: y, z :0};
|
||||
|
||||
var speed = 0.2;
|
||||
|
||||
var enemy = {
|
||||
mesh : box
|
||||
};
|
||||
|
||||
if (enemyType === 1) {
|
||||
position.x = -100;
|
||||
velocity = {x:1,y:0,z:0};
|
||||
velocity = {x:speed,y:0,z:0};
|
||||
}
|
||||
|
||||
if (enemyType === 2) {
|
||||
position.x = 100;
|
||||
velocity = {x:-1,y:0,z:0};
|
||||
velocity = {x:-speed,y:0,z:0};
|
||||
}
|
||||
|
||||
if (enemyType === 3) {
|
||||
position.x = -100;
|
||||
position.z = -100;
|
||||
velocity = {x:1,y:0,z:1};
|
||||
velocity = {x:speed,y:0,z:speed};
|
||||
}
|
||||
|
||||
if (enemyType === 4) {
|
||||
position.x = 100;
|
||||
position.z = -100;
|
||||
velocity = {x:-1,y:0,z:1};
|
||||
velocity = {x:-speed,y:0,z:speed};
|
||||
}
|
||||
|
||||
if (enemyType === 5) {
|
||||
position.x = 0;
|
||||
position.z = -100;
|
||||
velocity = {x:0,y:0,z:1};
|
||||
velocity = {x:0,y:0,z:speed};
|
||||
}
|
||||
|
||||
|
||||
|
@ -86,7 +88,7 @@ if (
|
|||
|
||||
enemy.velocity = velocity;
|
||||
enemy.lifeTime = 0;
|
||||
enemy.life = 5;
|
||||
enemy.life = 15;
|
||||
|
||||
this.enemies.push(enemy);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue