flechettes do poision damage
This commit is contained in:
105
js/bullets.js
105
js/bullets.js
@@ -73,7 +73,7 @@ const b = {
|
||||
},
|
||||
mods: [{
|
||||
name: "depleted uranium rounds",
|
||||
description: `your <strong>bullets</strong> are +13% larger<br>increased mass and physical <strong class='color-d'>damage</strong>`,
|
||||
description: `your <strong>bullets</strong> are <strong>+13%</strong> larger<br>increased mass and physical <strong class='color-d'>damage</strong>`,
|
||||
count: 0,
|
||||
maxCount: 9,
|
||||
allowed() {
|
||||
@@ -89,7 +89,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "fluoroantimonic acid",
|
||||
description: "each <strong>bullet</strong> does extra chemical <strong class='color-d'>damage</strong><br><strong>active</strong> when you are above <strong>80%</strong> base health",
|
||||
description: "each <strong>bullet</strong> does instant <strong class='color-d'>damage</strong><br><strong>active</strong> when you are above <strong>80%</strong> base health",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -108,7 +108,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "kinetic bombardment",
|
||||
description: "do up to 33% more <strong class='color-d'>damage</strong> at a distance<br><em>increase maxes out at about 40 steps away</em>",
|
||||
description: "do up to <strong>33%</strong> more <strong class='color-d'>damage</strong> at a distance<br><em>increase maxes out at about 40 steps away</em>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -156,7 +156,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "high explosives",
|
||||
description: "<strong class='color-e'>explosions</strong> do <strong>+20%</strong> more <strong class='color-d'>damage</strong><br><strong class='color-e'>explosive</strong> area is +44% <strong>larger</strong>",
|
||||
description: "<strong class='color-e'>explosions</strong> do <strong>+20%</strong> more <strong class='color-d'>damage</strong><br><strong class='color-e'>explosive</strong> area is <strong>+44% larger</strong>",
|
||||
maxCount: 3,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -172,7 +172,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "electric reactive armour",
|
||||
description: "<strong class='color-e'>explosions</strong> do no <strong>harm</strong><br> <strong class='color-e'>explosions</strong> drain <strong class='color-f'>energy</strong>",
|
||||
description: "<strong class='color-e'>explosions</strong> drain your <strong class='color-f'>energy</strong><br>instead of <strong>harming</strong> you",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -306,7 +306,7 @@ const b = {
|
||||
|
||||
{
|
||||
name: "zoospore vector",
|
||||
description: "mobs discharge <strong style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br>+11% chance",
|
||||
description: "mobs discharge <strong class='color-p' style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br><strong>+11%</strong> chance",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -409,7 +409,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "basidio-stomp",
|
||||
description: "hard landings disrupt <strong style='letter-spacing: 2px;'>spores</strong> from the ground<br>immune to <strong>harm</strong> from <strong>falling</strong>",
|
||||
description: "hard <strong>landings</strong> disrupt <strong class='color-p' style='letter-spacing: 2px;'>spores</strong> in the ground<br>immune to <strong>harm</strong> from <strong>falling</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -655,6 +655,22 @@ const b = {
|
||||
b.isModBayesian = 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "+1 cardinality",
|
||||
description: "one extra <strong>choice</strong> when selecting <strong>power ups</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return true
|
||||
},
|
||||
requires: "",
|
||||
effect: () => {
|
||||
b.isModFourOptions = true;
|
||||
},
|
||||
remove() {
|
||||
b.isModFourOptions = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "catabolism",
|
||||
description: "gain <strong>ammo</strong> when you <strong>fire</strong> while <strong>out</strong> of <strong>ammo</strong><br>drains <strong>3%</strong> of current remaining <strong>health</strong>",
|
||||
@@ -696,19 +712,31 @@ const b = {
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "+1 cardinality",
|
||||
description: "one extra <strong>choice</strong> when selecting <strong>power ups</strong>",
|
||||
name: "reallocation",
|
||||
description: "convert <strong>1</strong> random <strong class='color-m'>mod</strong> into <strong>2</strong> new <strong>guns</strong><br><em>recursive mods can lose all stacks</em>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return true
|
||||
return (b.modCount > 0) && !build.isCustomSelection
|
||||
},
|
||||
requires: "",
|
||||
requires: "at least 1 mod",
|
||||
effect: () => {
|
||||
b.isModFourOptions = true;
|
||||
const have = [] //find which mods you have
|
||||
for (let i = 0; i < b.mods.length; i++) {
|
||||
if (b.mods[i].count > 0) have.push(i)
|
||||
}
|
||||
const choose = have[Math.floor(Math.random() * have.length)]
|
||||
b.mods[choose].remove(); // remove a random mod form the list of mods you have
|
||||
b.mods[choose].count = 0;
|
||||
game.updateModHUD();
|
||||
|
||||
for (let i = 0; i < 2; i++) {
|
||||
powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
||||
if (Math.random() < b.isModBayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "gun");
|
||||
}
|
||||
},
|
||||
remove() {
|
||||
b.isModFourOptions = false;
|
||||
//nothing to remove
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -737,7 +765,7 @@ const b = {
|
||||
|
||||
{
|
||||
name: "ice crystal nucleation",
|
||||
description: "your <strong>minigun</strong> condenses unlimited <strong>ammo</strong><br>ice bullets made from water vapor <strong>slow</strong> mobs",
|
||||
description: "your <strong>minigun</strong> condenses <strong>unlimited ammo</strong><br>ice bullets made from water vapor <strong>slow</strong> mobs",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -834,7 +862,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "irradiated needles",
|
||||
description: "<strong>fléchette</strong> needles are exposed to <strong>radiation</strong><br>needles do <strong>3x</strong> <strong class='color-d'>damage</strong> over <strong>6</strong> seconds",
|
||||
description: "<strong>fléchette</strong> needles are exposed to <strong class='color-p'>radiation</strong><br>needles do <strong>2x</strong> <strong class='color-d'>damage</strong> spread over <strong>6</strong> seconds",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -936,7 +964,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "tinsellated flagella",
|
||||
description: "<strong style='letter-spacing: 2px;'>spores</strong> accelerate <strong>33% faster</strong>",
|
||||
description: "<strong class='color-p' style='letter-spacing: 2px;'>spores</strong> accelerate <strong>33% faster</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -1088,7 +1116,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "mycelium manufacturing",
|
||||
description: "<strong>nano-scale manufacturing</strong> is repurposed<br>excess <strong class='color-f'>energy</strong> used to grow <strong style='letter-spacing: 2px;'>spores</strong>",
|
||||
description: "<strong>nano-scale manufacturing</strong> is repurposed<br>excess <strong class='color-f'>energy</strong> used to grow <strong class='color-p' style='letter-spacing: 2px;'>spores</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -1335,7 +1363,7 @@ const b = {
|
||||
}
|
||||
}
|
||||
},
|
||||
explosion(where, radius) {
|
||||
explosion(where, radius, isBurn = false) {
|
||||
radius *= b.modExplosionRadius
|
||||
// typically explode is used for some bullets with .onEnd
|
||||
//add dmg to draw queue
|
||||
@@ -1430,7 +1458,9 @@ const b = {
|
||||
mob[i].force.x += knock.x;
|
||||
mob[i].force.y += knock.y;
|
||||
radius *= 0.93 //reduced range for each additional explosion target
|
||||
damageScale *= 0.8 //reduced damage for each additional explosion target
|
||||
damageScale *= 0.8 //reduced damage for each additional explosion target
|
||||
// mobs.statusBlind(mob[i])
|
||||
// if (isBurn) mobs.statusBurn(mob[i], 0.4) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds)
|
||||
} else if (!mob[i].seePlayer.recall && dist < alertRange) {
|
||||
mob[i].locatePlayer();
|
||||
knock = Vector.mult(Vector.normalise(sub), (-Math.sqrt(dmg * damageScale) * mob[i].mass) / 80);
|
||||
@@ -1690,7 +1720,7 @@ const b = {
|
||||
friction: 0,
|
||||
frictionAir: 0.025,
|
||||
thrust: b.isModFastSpores ? 0.0008 : 0.0004,
|
||||
dmg: 2.2, //damage done in addition to the damage from momentum
|
||||
dmg: 0, //2.2, //damage done in addition to the damage from momentum
|
||||
classType: "bullet",
|
||||
collisionFilter: {
|
||||
category: cat.bullet,
|
||||
@@ -1698,7 +1728,8 @@ const b = {
|
||||
},
|
||||
endCycle: game.cycle + Math.floor((660 + Math.floor(Math.random() * 240)) * b.isModBulletsLastLonger),
|
||||
minDmgSpeed: 0,
|
||||
onDmg() {
|
||||
onDmg(who) {
|
||||
mobs.statusPoison(who, 0.5, 180) // (2.2) * 1.3 * 30/180 // 6 ticks (3 seconds)
|
||||
this.endCycle = 0; //bullet ends cycle after doing damage
|
||||
},
|
||||
onEnd() {},
|
||||
@@ -2063,7 +2094,7 @@ const b = {
|
||||
},
|
||||
guns: [{
|
||||
name: "minigun", //0
|
||||
description: "rapidly fire a stream of small <strong>bullets</strong>",
|
||||
description: "<strong>rapidly</strong> fire a stream of small <strong>bullets</strong>",
|
||||
ammo: 0,
|
||||
ammoPack: 55,
|
||||
defaultAmmoPack: 55,
|
||||
@@ -2167,7 +2198,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "fléchettes", //3
|
||||
description: "fire a volley of <strong>precise</strong> high velocity needles",
|
||||
description: "fire a <strong>precise</strong> volley of <strong>high velocity</strong> needles<br>needles deliver <strong class='color-p'>chemical</strong> damage over 3 seconds",
|
||||
ammo: 0,
|
||||
ammoPack: 22,
|
||||
defaultAmmoPack: 22,
|
||||
@@ -2193,14 +2224,14 @@ const b = {
|
||||
bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45 * b.modBulletSize, 1.4 * b.modBulletSize, b.fireAttributes(angle));
|
||||
Matter.Body.setDensity(bullet[me], 0.0001); //0.001 is normal
|
||||
bullet[me].endCycle = game.cycle + 180;
|
||||
if (b.isModDotFlechette) {
|
||||
bullet[me].dmg = 0;
|
||||
bullet[me].onDmg = function (who) {
|
||||
mobs.statusDot(who, 0.35, 360) // (1.4) * 3 / 12 ticks (6 seconds)
|
||||
};
|
||||
} else {
|
||||
bullet[me].dmg = 1.4;
|
||||
}
|
||||
bullet[me].dmg = 0;
|
||||
bullet[me].onDmg = function (who) {
|
||||
if (b.isModDotFlechette) {
|
||||
mobs.statusPoison(who, 0.38, 360) // (2.3) * 2 / 14 ticks (2x damage over 7 seconds)
|
||||
} else {
|
||||
mobs.statusPoison(who, 0.38, 180) // (2.3) / 6 ticks (3 seconds)
|
||||
}
|
||||
};
|
||||
|
||||
bullet[me].do = function () {
|
||||
if (this.speed < 10) this.force.y += this.mass * 0.0003; //no gravity until it slows don to improve aiming
|
||||
@@ -2332,7 +2363,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "missiles",
|
||||
description: "fire missiles that accelerate towards mobs<br><strong class='color-e'>explodes</strong> when near target",
|
||||
description: "fire missiles that <strong>accelerate</strong> towards <strong>mobs</strong><br><strong class='color-e'>explodes</strong> when near target",
|
||||
ammo: 0,
|
||||
ammoPack: 4,
|
||||
have: false,
|
||||
@@ -2354,7 +2385,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "flak",
|
||||
description: "fire a cluster of short range projectiles<br><strong class='color-e'>explodes</strong> on contact or after half a second",
|
||||
description: "fire a <strong>cluster</strong> of short range <strong>projectiles</strong><br><strong class='color-e'>explodes</strong> on <strong>contact</strong> or after half a second",
|
||||
ammo: 0,
|
||||
ammoPack: 6,
|
||||
defaultAmmoPack: 6, //use to revert ammoPack after mod changes drop rate
|
||||
@@ -2400,7 +2431,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "grenades", //7
|
||||
description: "lob a single bouncy projectile<br><strong class='color-e'>explodes</strong> on contact or after one second",
|
||||
description: "lob a single <strong>bouncy</strong> projectile<br><strong class='color-e'>explodes</strong> on <strong>contact</strong> or after one second",
|
||||
ammo: 0,
|
||||
ammoPack: 7,
|
||||
have: false,
|
||||
@@ -2559,7 +2590,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "spores", //10
|
||||
description: "fire orbs that discharge <strong style='letter-spacing: 2px;'>spores</strong><br><strong style='letter-spacing: 2px;'>spores</strong> seek out mobs",
|
||||
description: "fire <strong>sporangiums</strong> that discharge <strong class='color-p' style='letter-spacing: 2px;'>spores</strong><br><strong class='color-p' style='letter-spacing: 2px;'>spores</strong> do <strong class='color-d'>damage</strong> over <strong>3</strong> seconds",
|
||||
ammo: 0,
|
||||
ammoPack: (game.difficultyMode > 3) ? 3 : 4,
|
||||
have: false,
|
||||
@@ -3120,7 +3151,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "pulse", //15
|
||||
description: "convert 25% of your <strong class='color-f'>energy</strong> into a pulsed laser<br>instantly initiates a fusion <strong class='color-e'>explosion</strong>",
|
||||
description: "convert <strong>25%</strong> of your <strong class='color-f'>energy</strong> into a pulsed laser<br>instantly initiates a fusion <strong class='color-e'>explosion</strong>",
|
||||
ammo: 0,
|
||||
ammoPack: Infinity,
|
||||
have: false,
|
||||
@@ -3202,7 +3233,7 @@ const b = {
|
||||
//use energy to explode
|
||||
const energy = 0.3 * Math.min(mech.energy, 1.75)
|
||||
mech.energy -= energy
|
||||
if (best.who) b.explosion(path[1], 1000 * energy)
|
||||
if (best.who) b.explosion(path[1], 1000 * energy, true)
|
||||
mech.fireCDcycle = mech.cycle + Math.floor(60 * b.modFireRate); // cool down
|
||||
|
||||
//draw laser beam
|
||||
|
||||
@@ -14,13 +14,13 @@ const level = {
|
||||
start() {
|
||||
if (level.levelsCleared === 0) {
|
||||
// level.difficultyIncrease(9)
|
||||
b.giveGuns("fléchettes")
|
||||
// b.giveGuns("fléchettes")
|
||||
// mech.setField("phase decoherence field")
|
||||
b.giveMod("irradiated needles");
|
||||
// b.giveMod("irradiated needles");
|
||||
// b.giveMod("reflective cavity");
|
||||
|
||||
// level.intro(); //starting level
|
||||
level.testingMap();
|
||||
level.intro(); //starting level
|
||||
// level.testingMap();
|
||||
// level.bosses();
|
||||
// level.satellite();
|
||||
// level.skyscrapers();
|
||||
|
||||
159
js/mobs.js
159
js/mobs.js
@@ -54,7 +54,6 @@ const mobs = {
|
||||
while (i--) {
|
||||
if (who.status[i].type === "slow") who.status.splice(i, 1);
|
||||
}
|
||||
//add a new slow effect
|
||||
who.status.push({
|
||||
effect() {
|
||||
Matter.Body.setVelocity(who, {
|
||||
@@ -78,7 +77,25 @@ const mobs = {
|
||||
endCycle: game.cycle + cycles,
|
||||
})
|
||||
},
|
||||
statusDot(who, tickDamage, cycles = 180) {
|
||||
statusBlind(who, cycles = 60) {
|
||||
//remove other "stun" effects on this mob
|
||||
let i = who.status.length
|
||||
while (i--) {
|
||||
if (who.status[i].type === "blind") who.status.splice(i, 1);
|
||||
}
|
||||
who.status.push({
|
||||
effect() {
|
||||
// Matter.Body.setVelocity(who, {
|
||||
// x: 0,
|
||||
// y: 0
|
||||
// });
|
||||
// Matter.Body.setAngularVelocity(who, 0);
|
||||
},
|
||||
type: "blind",
|
||||
endCycle: game.cycle + cycles,
|
||||
})
|
||||
},
|
||||
statusPoison(who, tickDamage, cycles = 180) {
|
||||
who.status.push({
|
||||
effect() {
|
||||
if ((game.cycle - this.startCycle) % 30 === 0) {
|
||||
@@ -88,12 +105,37 @@ const mobs = {
|
||||
x: who.position.x,
|
||||
y: who.position.y,
|
||||
radius: Math.log(2 * dmg + 1.1) * 40,
|
||||
color: game.playerDmgColor,
|
||||
color: "rgba(0,80,80,0.9)",
|
||||
time: game.drawTime
|
||||
});
|
||||
}
|
||||
},
|
||||
type: "dot",
|
||||
type: "poison",
|
||||
endCycle: game.cycle + cycles,
|
||||
startCycle: game.cycle
|
||||
})
|
||||
},
|
||||
statusBurn(who, tickDamage, cycles = 90 + Math.floor(90 * Math.random())) {
|
||||
//remove other "burn" effects on this mob
|
||||
let i = who.status.length
|
||||
while (i--) {
|
||||
if (who.status[i].type === "burn") who.status.splice(i, 1);
|
||||
}
|
||||
who.status.push({
|
||||
effect() {
|
||||
if ((game.cycle - this.startCycle) % 15 === 0) {
|
||||
let dmg = b.dmgScale * tickDamage * 0.5 * (1 + Math.random())
|
||||
who.damage(dmg);
|
||||
game.drawList.push({ //add dmg to draw queue
|
||||
x: who.position.x,
|
||||
y: who.position.y,
|
||||
radius: Math.log(2 * dmg + 1.1) * 40,
|
||||
color: `rgba(255,${Math.floor(255*Math.random())},0,0.9)`,
|
||||
time: game.drawTime
|
||||
});
|
||||
}
|
||||
},
|
||||
type: "burn",
|
||||
endCycle: game.cycle + cycles,
|
||||
startCycle: game.cycle
|
||||
})
|
||||
@@ -282,38 +324,26 @@ const mobs = {
|
||||
x: player.position.x, // + (Math.random() - 0.5) * 50,
|
||||
y: player.position.y + (Math.random() - 0.5) * 110
|
||||
};
|
||||
//mob vision for testing
|
||||
// ctx.beginPath();
|
||||
// ctx.lineWidth = "5";
|
||||
// ctx.strokeStyle = "#ff0";
|
||||
// ctx.moveTo(this.position.x, this.position.y);
|
||||
// ctx.lineTo(targetPos.x, targetPos.y);
|
||||
// ctx.stroke();
|
||||
// return targetPos;
|
||||
},
|
||||
|
||||
hacked() { //set this.hackedTarget variable before running this method
|
||||
//find a new target
|
||||
if (!(game.cycle % this.seePlayerFreq)) {
|
||||
this.hackedTarget = null
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
if (mob[i] !== this) {
|
||||
// const DIST = Vector.magnitude(Vector.sub(this.position, mob[j]));
|
||||
if (Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
|
||||
Matter.Query.ray(body, this.position, mob[i].position).length === 0) {
|
||||
this.hackedTarget = mob[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//acceleration towards targets
|
||||
if (this.hackedTarget) {
|
||||
this.force = Vector.mult(Vector.normalise(Vector.sub(this.hackedTarget.position, this.position)), this.mass * 0.0015)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// hacked() { //set this.hackedTarget variable before running this method
|
||||
// //find a new target
|
||||
// if (!(game.cycle % this.seePlayerFreq)) {
|
||||
// this.hackedTarget = null
|
||||
// for (let i = 0, len = mob.length; i < len; i++) {
|
||||
// if (mob[i] !== this) {
|
||||
// // const DIST = Vector.magnitude(Vector.sub(this.position, mob[j]));
|
||||
// if (Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
|
||||
// Matter.Query.ray(body, this.position, mob[i].position).length === 0) {
|
||||
// this.hackedTarget = mob[i]
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// //acceleration towards targets
|
||||
// if (this.hackedTarget) {
|
||||
// this.force = Vector.mult(Vector.normalise(Vector.sub(this.hackedTarget.position, this.position)), this.mass * 0.0015)
|
||||
// }
|
||||
// },
|
||||
laserBeam() {
|
||||
if (game.cycle % 7 && this.seePlayer.yes) {
|
||||
ctx.setLineDash([125 * Math.random(), 125 * Math.random()]);
|
||||
@@ -564,66 +594,7 @@ const mobs = {
|
||||
mob[i].locatePlayer();
|
||||
}
|
||||
}
|
||||
//add alert to draw queue
|
||||
// game.drawList.push({
|
||||
// x: this.position.x,
|
||||
// y: this.position.y,
|
||||
// radius: Math.sqrt(this.alertRange2),
|
||||
// color: "rgba(0,0,0,0.02)",
|
||||
// time: game.drawTime
|
||||
// });
|
||||
},
|
||||
// zoom() {
|
||||
// this.zoomMode--;
|
||||
// if (this.zoomMode > 150) {
|
||||
// this.drawTrail();
|
||||
// if (this.seePlayer.recall) {
|
||||
// //attraction to player
|
||||
// const forceMag = this.accelMag * this.mass;
|
||||
// const angle = Math.atan2(player.position.y - this.position.y, player.position.x - this.position.x);
|
||||
// this.force.x += forceMag * Math.cos(angle);
|
||||
// this.force.y += forceMag * Math.sin(angle);
|
||||
// }
|
||||
// } else if (this.zoomMode < 0) {
|
||||
// this.zoomMode = 300;
|
||||
// this.setupTrail();
|
||||
// }
|
||||
// },
|
||||
// setupTrail() {
|
||||
// this.trail = [];
|
||||
// for (let i = 0; i < this.trailLength; ++i) {
|
||||
// this.trail.push({
|
||||
// x: this.position.x,
|
||||
// y: this.position.y
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// drawTrail() {
|
||||
// //dont' forget to run setupTrail() after mob spawn
|
||||
// const t = this.trail;
|
||||
// const len = t.length;
|
||||
// t.pop();
|
||||
// t.unshift({
|
||||
// x: this.position.x,
|
||||
// y: this.position.y
|
||||
// });
|
||||
// //draw
|
||||
// ctx.strokeStyle = this.trailFill;
|
||||
// ctx.beginPath();
|
||||
// // ctx.moveTo(t[0].x, t[0].y);
|
||||
// // ctx.lineTo(t[0].x, t[0].y);
|
||||
// // ctx.globalAlpha = 0.2;
|
||||
// // ctx.lineWidth = this.radius * 3;
|
||||
// // ctx.stroke();
|
||||
// ctx.globalAlpha = 0.5 / len;
|
||||
// ctx.lineWidth = this.radius * 1.95;
|
||||
// for (let i = 0; i < len; ++i) {
|
||||
// // ctx.lineWidth *= 0.96;
|
||||
// ctx.lineTo(t[i].x, t[i].y);
|
||||
// ctx.stroke();
|
||||
// }
|
||||
// ctx.globalAlpha = 1;
|
||||
// },
|
||||
curl(range = 1000, mag = -10) {
|
||||
//cause all mobs, and bodies to rotate in a circle
|
||||
applyCurl = function (center, array) {
|
||||
|
||||
Reference in New Issue
Block a user