swarn gun

This commit is contained in:
landgreen
2020-03-24 15:50:51 -07:00
parent f08996b2fc
commit af7a33ba83
8 changed files with 268 additions and 85 deletions

View File

@@ -743,17 +743,18 @@ const spawn = {
}
me.dmg = 0.14 * game.dmgScale;
me.frictionAir = 0.03;
me.torque -= me.inertia * 0.002
Matter.Body.rotate(me, 0.25);
// me.torque -= me.inertia * 0.002
Matter.Body.setDensity(me, 0.03); //extra dense //normal is 0.001 //makes effective life much larger
// spawn.shield(me, x, y, 1); //not working, not sure why
me.onDeath = function () {
powerUps.spawnBossPowerUp(this.position.x, this.position.y)
};
me.rotateVelocity = 0.0035 * Math.sqrt(game.accelScale) * (level.levelsCleared > 8 ? 1 : -1)
me.do = function () {
this.fill = '#' + Math.random().toString(16).substr(-6); //flash colors
// Matter.Body.rotate(this, -0.003 / (0.3 + this.health))
this.torque -= this.inertia * 0.0000025 / (4 + this.health);
Matter.Body.rotate(me, this.rotateVelocity)
// this.torque -= this.inertia * 0.0000025 / (4 + this.health);
Matter.Body.setVelocity(this, {
x: 0,
y: 0