diff --git a/js/bullets.js b/js/bullets.js
index d76da67..49fc624 100644
--- a/js/bullets.js
+++ b/js/bullets.js
@@ -29,7 +29,7 @@ const b = {
},
mods: [{
name: "depleted uranium rounds",
- description: "your bullets are larger and do more physical damage",
+ description: "your bullets are larger and do more physical damage",
have: false,
effect: () => {
//good for guns that do mostly projectile damage:
@@ -41,7 +41,7 @@ const b = {
},
{
name: "auto-loading heuristics",
- description: "your rate of fire is 15% faster",
+ description: "your rate of fire is 15% faster",
have: false,
effect: () => {
//good for guns with extra ammo: needles, M80, rapid fire, flak, super balls
@@ -51,7 +51,7 @@ const b = {
},
{
name: "desublimated ammunition",
- description: "use 50% less ammo when crouching",
+ description: "use 50% less ammo when crouching",
have: false,
effect: () => {
//good with guns that have less ammo: one shot, grenades, missiles, super balls, spray
@@ -60,7 +60,7 @@ const b = {
},
{
name: "corrosion resistant topology",
- description: "your bullets last 40% longer",
+ description: "your bullets last 40% longer",
have: false,
effect: () => {
//good with: drones, super balls, spore, missiles, wave beam(range), rapid fire(range), flak(range)
@@ -69,7 +69,7 @@ const b = {
},
{
name: "anti-matter cores",
- description: "the radius of your explosions is doubled",
+ description: "the radius of your explosions is doubled
be careful",
have: false,
effect: () => {
//at 1.4 gives a flat 40% increase, and increased range, balanced by limited guns and self damage
@@ -79,16 +79,16 @@ const b = {
},
{
name: "energy siphon",
- description: "regenerate energy proportional to your damage done",
+ description: "regenerate energy proportional to your damage done",
have: false,
effect: () => {
//good with laser, and all fields
- b.modEnergySiphon = 0.25;
+ b.modEnergySiphon = 0.2;
}
},
{
name: "entropy transfer",
- description: "heal proportional to your damage done",
+ description: "heal proportional to your damage done",
have: false,
effect: () => {
//good with guns that overkill: one shot, grenade
@@ -97,7 +97,7 @@ const b = {
},
{
name: "quantum immortality",
- description: "after you die continue in an alternate reality with randomized abilities",
+ description: "after you die continue in an alternate reality
guns, ammo, and field are randomized",
have: false,
effect: () => {
b.modIsImmortal = true;
@@ -105,7 +105,7 @@ const b = {
},
{
name: "zoospore vector",
- description: "when an enemy dies it has a 20% chance to release spores",
+ description: "when an enemy dies it has a 20% chance to release spores",
have: false,
effect: () => {
b.modSpores = 0.20; //good late game maybe?
@@ -128,6 +128,7 @@ const b = {
giveGuns(gun = "all", ammoPacks = 2) {
if (gun === "all") {
b.activeGun = 0;
+ b.inventoryGun = 0;
for (let i = 0; i < b.guns.length; i++) {
b.guns[i].have = true;
b.guns[i].ammo = b.guns[i].ammoPack * ammoPacks;
@@ -277,7 +278,7 @@ const b = {
x: bullet[me].position.x,
y: bullet[me].position.y,
radius: radius,
- color: "rgba(255,0,0,0.4)",
+ color: "rgba(255,25,0,0.6)",
time: game.drawTime
});
let dist, sub, knock;
@@ -297,7 +298,7 @@ const b = {
sub = Matter.Vector.sub(bullet[me].position, player.position);
dist = Matter.Vector.magnitude(sub);
if (dist < radius) {
- mech.damage(radius * 0.00035);
+ mech.damage(radius * 0.0002);
knock = Matter.Vector.mult(Matter.Vector.normalise(sub), -Math.sqrt(dmg) * player.mass / 30);
player.force.x += knock.x;
player.force.y += knock.y;
@@ -309,7 +310,6 @@ const b = {
mech.drop();
}
-
//body knock backs
for (let i = 0, len = body.length; i < len; ++i) {
sub = Matter.Vector.sub(bullet[me].position, body[i].position);
@@ -340,54 +340,6 @@ const b = {
}
}
- // bullet knock backs (not working: no effect for drones, crash for superballs)
- // for (let i = 0, len = bullet.length; i < len; ++i) {
- // if (me !== i) {
- // sub = Matter.Vector.sub(bullet[me].position, bullet[i].position);
- // dist = Matter.Vector.magnitude(sub);
- // if (dist < radius) {
- // knock = Matter.Vector.mult(Matter.Vector.normalise(sub), (-Math.sqrt(dmg) * bullet[i].mass) / 10);
- // bullet[i].force.x += knock.x;
- // bullet[i].force.y += knock.y;
- // console.log(sub, dist, knock)
- // } else if (dist < alertRange) {
- // knock = Matter.Vector.mult(Matter.Vector.normalise(sub), (-Math.sqrt(dmg) * bullet[i].mass) / 20);
- // bullet[i].force.x += knock.x;
- // bullet[i].force.y += knock.y;
- // }
- // }
- // }
-
- //destroy all bullets in range
- // for (let i = 0, len = bullet.length; i < len; ++i) {
- // if (me != i) {
- // sub = Matter.Vector.sub(bullet[me].position, bullet[i].position);
- // dist = Matter.Vector.magnitude(sub);
- // if (dist < radius) {
- // bullet[i].endCycle = mech.cycle;
- // }
- // }
- // }
-
- //mob damage and knock back with no alert
- // for (let i = 0, len = mob.length; i < len; ++i) {
- // if (mob[i].alive) {
- // let vertices = mob[i].vertices;
- // for (let j = 0, len = vertices.length; j < len; j++) {
- // sub = Matter.Vector.sub(bullet[me].position, vertices[j]);
- // dist = Matter.Vector.magnitude(sub);
- // if (dist < radius) {
- // mob[i].damage(dmg);
- // mob[i].locatePlayer();
- // knock = Matter.Vector.mult(Matter.Vector.normalise(sub), -Math.sqrt(dmg) * mob[i].mass / 18);
- // mob[i].force.x += knock.x;
- // mob[i].force.y += knock.y;
- // break;
- // }
- // }
- // }
- // }
-
//mob damage and knock back with alert
let damageScale = 1; // reduce dmg for each new target to limit total AOE damage
for (let i = 0, len = mob.length; i < len; ++i) {
@@ -475,7 +427,7 @@ const b = {
},
guns: [{
name: "laser",
- description: "fire a beam of coherent light
reflects off walls at 75% intensity
uses energy instead of ammunition",
+ description: "fire a beam of coherent light
reflects off walls at 75% intensity
uses energy instead of ammunition",
ammo: 0,
// ammoPack: 350,
ammoPack: Infinity,
@@ -633,132 +585,9 @@ const b = {
ctx.globalAlpha = 1;
}
}
- // }, {
- // name: "entropic beam",
- // description: "steal entropy to heal
reflects off walls at 75% intensity
uses energy instead of ammunition",
- // ammo: 0,
- // // ammoPack: 350,
- // ammoPack: Infinity,
- // have: false,
- // fire() {
- // // mech.fireCDcycle = mech.cycle + 1
- // //laser drains energy as well as bullets
- // const FIELD_DRAIN = 0.0001 //should be 0.001
- // if (mech.fieldMeter < FIELD_DRAIN) {
- // mech.fireCDcycle = mech.cycle + 100; // cool down if out of energy
- // } else {
- // mech.fieldMeter -= mech.fieldRegen + FIELD_DRAIN
- // let best;
- // const color = "#a0a";
- // const range = 600;
- // const path = [{
- // x: mech.pos.x + 20 * Math.cos(mech.angle),
- // y: mech.pos.y + 20 * Math.sin(mech.angle)
- // },
- // {
- // x: mech.pos.x + range * Math.cos(mech.angle),
- // y: mech.pos.y + range * Math.sin(mech.angle)
- // }
- // ];
- // const vertexCollision = function (v1, v1End, domain) {
- // for (let i = 0; i < domain.length; ++i) {
- // let vertices = domain[i].vertices;
- // const len = vertices.length - 1;
- // for (let j = 0; j < len; j++) {
- // results = game.checkLineIntersection(v1, v1End, vertices[j], vertices[j + 1]);
- // if (results.onLine1 && results.onLine2) {
- // const dx = v1.x - results.x;
- // const dy = v1.y - results.y;
- // const dist2 = dx * dx + dy * dy;
- // if (dist2 < best.dist2 && (!domain[i].mob || domain[i].alive)) {
- // best = {
- // x: results.x,
- // y: results.y,
- // dist2: dist2,
- // who: domain[i],
- // v1: vertices[j],
- // v2: vertices[j + 1]
- // };
- // }
- // }
- // }
- // results = game.checkLineIntersection(v1, v1End, vertices[0], vertices[len]);
- // if (results.onLine1 && results.onLine2) {
- // const dx = v1.x - results.x;
- // const dy = v1.y - results.y;
- // const dist2 = dx * dx + dy * dy;
- // if (dist2 < best.dist2 && (!domain[i].mob || domain[i].alive)) {
- // best = {
- // x: results.x,
- // y: results.y,
- // dist2: dist2,
- // who: domain[i],
- // v1: vertices[0],
- // v2: vertices[len]
- // };
- // }
- // }
- // }
- // };
- // const checkforCollisions = function () {
- // best = {
- // x: null,
- // y: null,
- // dist2: Infinity,
- // who: null,
- // v1: null,
- // v2: null
- // };
- // vertexCollision(path[path.length - 2], path[path.length - 1], mob);
- // vertexCollision(path[path.length - 2], path[path.length - 1], map);
- // vertexCollision(path[path.length - 2], path[path.length - 1], body);
- // };
- // const laserHitMob = function (dmg) {
- // if (best.who.alive) {
- // dmg *= b.dmgScale * 0.02;
- // mech.addHealth(0.002)
- // best.who.damage(dmg);
- // best.who.locatePlayer();
- // //draw mob damage circle
- // ctx.fillStyle = color;
- // ctx.beginPath();
- // ctx.arc(path[path.length - 1].x, path[path.length - 1].y, Math.sqrt(dmg) * 100, 0, 2 * Math.PI);
- // ctx.fill();
- // }
- // };
- // checkforCollisions();
- // if (best.dist2 != Infinity) {
- // //if hitting something
- // path[path.length - 1] = {
- // x: best.x,
- // y: best.y
- // };
- // laserHitMob(1);
- // }
- // ctx.fillStyle = color;
- // ctx.strokeStyle = color;
- // ctx.lineWidth = 4;
- // for (let i = 1, len = path.length; i < len; ++i) {
- // d = {
- // x: path[i].x - path[i - 1].x,
- // y: path[i].y - path[i - 1].y
- // }
- // const a = mech.cycle * 5
- // p1 = {
- // x: d.x / 2 * Math.cos(a) - d.y / 2 * Math.sin(a),
- // y: d.x / 2 * Math.sin(a) + d.y / 2 * Math.cos(a),
- // }
- // const wave = 300 / Math.sqrt(d.x * d.x + d.y * d.y)
- // ctx.beginPath();
- // ctx.moveTo(path[i - 1].x, path[i - 1].y);
- // ctx.bezierCurveTo(path[i - 1].x + p1.x * wave, path[i - 1].y + p1.y * wave, path[i].x + p1.x * wave, path[i].y + p1.y * wave, path[i].x, path[i].y);
- // ctx.stroke();
- // }
- // }
- // }
}, {
name: "kinetic slugs",
- description: "fire a huge rod with high recoil
effective at long distances",
+ description: "fire a large rod that does excessive physical damage
high recoil",
ammo: 0,
ammoPack: 5,
have: false,
@@ -782,7 +611,7 @@ const b = {
},
{
name: "minigun",
- description: "fire a stream of bullets",
+ description: "rapidly fire a stream of small bullets",
ammo: 0,
ammoPack: 105,
have: false,
@@ -790,11 +619,11 @@ const b = {
const me = bullet.length;
b.muzzleFlash(15);
// if (Math.random() > 0.2) mobs.alert(500);
- const dir = mech.angle + (Math.random() - 0.5) * ((mech.crouch) ? 0.07 : 0.16);
+ const dir = mech.angle + (Math.random() - 0.5) * ((mech.crouch) ? 0.03 : 0.14);
bullet[me] = Bodies.rectangle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 17 * b.modBulletSize, 5 * b.modBulletSize, b.fireAttributes(dir));
b.fireProps(mech.crouch ? 11 : 5, mech.crouch ? 44 : 36, dir, me); //cd , speed
bullet[me].endCycle = game.cycle + Math.floor(65 * b.modBulletsLastLonger);
- bullet[me].frictionAir = 0.01;
+ bullet[me].frictionAir = mech.crouch ? 0.007 : 0.01;
bullet[me].do = function () {
this.force.y += this.mass * 0.0005;
};
@@ -802,7 +631,7 @@ const b = {
},
{
name: "wave beam",
- description: "fire a stream of oscillating particles
propagates through solids
effective at close range",
+ description: "fire a stream of oscillating particles
propagates through solids",
ammo: 0,
ammoPack: 85,
have: false,
@@ -855,7 +684,7 @@ const b = {
},
{
name: "super balls",
- description: "fire 3 very bouncy balls",
+ description: "fire 3 very bouncy balls",
ammo: 0,
ammoPack: 11,
have: false,
@@ -883,7 +712,7 @@ const b = {
},
{
name: "shotgun",
- description: "fire a burst of bullets with high recoil
more effective at close range",
+ description: "fire a burst of bullets
high recoil",
ammo: 0,
ammoPack: 8,
have: false,
@@ -911,7 +740,7 @@ const b = {
},
{
name: "fléchettes",
- description: "fire a narrow projectile
effective at long distances",
+ description: "fire an accurate high speed needle
",
ammo: 0,
ammoPack: 19,
have: false,
@@ -935,9 +764,9 @@ const b = {
},
{
name: "missiles",
- description: "fire a missile that accelerates towards nearby targets
explodes when near target",
+ description: "fire a missile that accelerates towards nearby targets
explodes when near target",
ammo: 0,
- ammoPack: 9,
+ ammoPack: 8,
have: false,
fireCycle: 0,
ammoLoaded: 0,
@@ -953,7 +782,7 @@ const b = {
bullet[me].force.y += 0.00045; //a small push down at first to make it seem like the missile is briefly falling
bullet[me].frictionAir = 0
bullet[me].endCycle = game.cycle + Math.floor((265 + Math.random() * 20) * b.modBulletsLastLonger);
- bullet[me].explodeRad = 150 + 40 * Math.random();
+ bullet[me].explodeRad = 165 + 40 * Math.random();
bullet[me].lookFrequency = Math.floor(8 + Math.random() * 7);
bullet[me].onEnd = b.explode; //makes bullet do explosive damage at end
bullet[me].onDmg = function () {
@@ -1040,7 +869,7 @@ const b = {
},
{
name: "flak",
- description: "fire a cluster of explosive projectiles
explode on contact or after half a second",
+ description: "fire a cluster of short range projectiles
explode on contact or after half a second",
ammo: 0,
ammoPack: 20,
have: false,
@@ -1048,9 +877,9 @@ const b = {
b.muzzleFlash(30);
const totalBullets = 5
const angleStep = (mech.crouch ? 0.06 : 0.15) / totalBullets
- const SPEED = mech.crouch ? 27 : 20
- const CD = mech.crouch ? 30 : 15
- const END = Math.floor((mech.crouch ? 27 : 18) * b.modBulletsLastLonger);
+ const SPEED = mech.crouch ? 30 : 25
+ const CD = mech.crouch ? 45 : 11
+ const END = Math.floor((mech.crouch ? 30 : 18) * b.modBulletsLastLonger);
let dir = mech.angle - angleStep * totalBullets / 2;
const side1 = 17 * b.modBulletSize
const side2 = 4 * b.modBulletSize
@@ -1059,13 +888,13 @@ const b = {
dir += angleStep
const me = bullet.length;
bullet[me] = Bodies.rectangle(mech.pos.x + 50 * Math.cos(mech.angle), mech.pos.y + 50 * Math.sin(mech.angle), side1, side2, b.fireAttributes(dir));
- b.fireProps(CD, SPEED + 25 * Math.random() - i, dir, me); //cd , speed
+ b.fireProps(CD, SPEED + 15 * Math.random() - 2 * i, dir, me); //cd , speed
// Matter.Body.setDensity(bullet[me], 0.005);
- bullet[me].endCycle = i + game.cycle + END
+ bullet[me].endCycle = 2 * i + game.cycle + END
bullet[me].restitution = 0;
bullet[me].friction = 1;
// bullet[me].dmg = 0.15;
- bullet[me].explodeRad = 45 + (Math.random() - 0.5) * 50;
+ bullet[me].explodeRad = (mech.crouch ? 70 : 45) + (Math.random() - 0.5) * 50;
bullet[me].onEnd = b.explode;
bullet[me].onDmg = function () {
this.endCycle = 0; //bullet ends cycle after hitting a mob and triggers explosion
@@ -1083,50 +912,48 @@ const b = {
},
{
name: "grenades",
- description: "fire a bomb that explodes on contact or after 1.6 seconds",
+ description: "fire a projectile that explodes on contact or after one second",
ammo: 0,
- ammoPack: 14,
+ ammoPack: 11,
have: false,
fire() {
const me = bullet.length;
const dir = mech.angle; // + Math.random() * 0.05;
bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 15 * b.modBulletSize, b.fireAttributes(dir, false));
- b.fireProps(mech.crouch ? 40 : 25, mech.crouch ? 41 : 32, dir, me); //cd , speed
+ b.fireProps(mech.crouch ? 40 : 20, mech.crouch ? 43 : 32, dir, me); //cd , speed
b.drawOneBullet(bullet[me].vertices);
// Matter.Body.setDensity(bullet[me], 0.000001);
bullet[me].totalCycles = 100;
- bullet[me].endCycle = game.cycle + Math.floor(70 * b.modBulletsLastLonger);
- bullet[me].restitution = 0.25;
- bullet[me].explodeRad = 220;
+ bullet[me].endCycle = game.cycle + Math.floor((mech.crouch ? 120 : 60) * b.modBulletsLastLonger);
+ bullet[me].restitution = 0.5;
+ bullet[me].explodeRad = 210;
bullet[me].onEnd = b.explode; //makes bullet do explosive damage before despawn
bullet[me].minDmgSpeed = 1;
- bullet[me].dmg = 0.5;
bullet[me].onDmg = function () {
- this.endCycle = 0; //bullet ends cycle after doing damage //this triggers explosion
+ this.endCycle = 0; //bullet ends cycle after doing damage //this also triggers explosion
};
bullet[me].do = function () {
//extra gravity for harder arcs
- this.force.y += this.mass * 0.0022;
+ this.force.y += this.mass * 0.002;
};
}
},
{
name: "vacuum bomb",
- description: "fire a huge bomb that sucks before it explodes",
+ description: "fire a huge bomb that sucks before it explodes
click left mouse again to detonate",
ammo: 0,
- ammoPack: 5,
+ ammoPack: 4,
have: false,
fire() {
const me = bullet.length;
const dir = mech.angle;
bullet[me] = Bodies.circle(mech.pos.x + 30 * Math.cos(mech.angle), mech.pos.y + 30 * Math.sin(mech.angle), 26 * b.modBulletSize, b.fireAttributes(dir, false));
bullet[me].radius = 22; //used from drawing timer
- b.fireProps(mech.crouch ? 80 : 50, mech.crouch ? 37 : 0, dir, me); //cd , speed
+ b.fireProps(10, mech.crouch ? 42 : 26, dir, me); //cd , speed
b.drawOneBullet(bullet[me].vertices);
- // Matter.Body.setDensity(bullet[me], 0.001);
- bullet[me].endCycle = game.cycle + Math.floor((mech.crouch ? 100 : 150) * b.modBulletsLastLonger);
- bullet[me].endCycleLength = bullet[me].endCycle - game.cycle
+ bullet[me].endCycle = Infinity
+ bullet[me].endCycle = Infinity
// bullet[me].restitution = 0.3;
// bullet[me].frictionAir = 0.01;
// bullet[me].friction = 0.15;
@@ -1140,78 +967,89 @@ const b = {
bullet[me].onDmg = function () {
// this.endCycle = 0; //bullet ends cycle after doing damage //this triggers explosion
};
+ bullet[me].isArmed = false;
+ bullet[me].isSucking = false;
bullet[me].do = function () {
//extra gravity for harder arcs
this.force.y += this.mass * 0.0022;
+ mech.fireCDcycle = mech.cycle + 10 //can't fire until after the explosion
- //before the explosion suck in stuff
- if (game.cycle > this.endCycle - 35 && !mech.isBodiesAsleep) {
- const that = this
- let mag = 0.1
+ //set armed and sucking status
+ if (!this.isArmed && !game.mouseDown) {
+ this.isArmed = true
+ } else if (this.isArmed && game.mouseDown && !this.isSucking) {
+ this.isSucking = true;
+ this.endCycle = game.cycle + 35;
+ }
- function suck(who, radius = that.explodeRad * 2) {
- for (i = 0, len = who.length; i < len; i++) {
- const sub = Matter.Vector.sub(that.position, who[i].position);
- const dist = Matter.Vector.magnitude(sub);
- if (dist < radius && dist > 150) {
- knock = Matter.Vector.mult(Matter.Vector.normalise(sub), mag * who[i].mass / Math.sqrt(dist));
- who[i].force.x += knock.x;
- who[i].force.y += knock.y;
+ if (this.isSucking) {
+ if (!mech.isBodiesAsleep) {
+ const that = this
+ let mag = 0.1
+
+ function suck(who, radius = that.explodeRad * 2) {
+ for (i = 0, len = who.length; i < len; i++) {
+ const sub = Matter.Vector.sub(that.position, who[i].position);
+ const dist = Matter.Vector.magnitude(sub);
+ if (dist < radius && dist > 150) {
+ knock = Matter.Vector.mult(Matter.Vector.normalise(sub), mag * who[i].mass / Math.sqrt(dist));
+ who[i].force.x += knock.x;
+ who[i].force.y += knock.y;
+ }
}
}
+ if (game.cycle > this.endCycle - 5) {
+ mag = -0.22
+ suck(body)
+ suck(mob)
+ suck(powerUp)
+ suck([player])
+ } else {
+ mag = 0.1
+ suck(body)
+ suck(mob)
+ suck(powerUp)
+ suck([player])
+ }
+ //keep bomb in place
+ Matter.Body.setVelocity(this, {
+ x: 0,
+ y: 0
+ });
+ //draw suck
+ const radius = 2.5 * this.explodeRad * (this.endCycle - game.cycle) / 35
+ ctx.fillStyle = "rgba(0,0,0,0.1)";
+ ctx.beginPath();
+ ctx.arc(this.position.x, this.position.y, radius, 0, 2 * Math.PI);
+ ctx.fill();
}
- if (game.cycle > this.endCycle - 5) {
- mag = -0.22
- suck(body)
- suck(mob)
- suck(powerUp)
- suck([player])
- } else {
- mag = 0.1
- suck(body)
- suck(mob)
- suck(powerUp)
- suck([player])
+ } else {
+ // flashing lights to show armed
+ if (!(game.cycle % 10)) {
+ if (this.isFlashOn) {
+ this.isFlashOn = false;
+ } else {
+ this.isFlashOn = true;
+ }
}
-
- //keep bomb in place
- Matter.Body.setVelocity(this, {
- x: 0,
- y: 0
- });
- //draw suck
- const radius = 9 * this.explodeRad * (this.endCycle - game.cycle) / this.endCycleLength
- ctx.fillStyle = "rgba(0,0,0,0.1)";
- ctx.beginPath();
- ctx.arc(this.position.x, this.position.y, radius, 0, 2 * Math.PI);
- ctx.fill();
- }
-
- //draw timer
- if (!(game.cycle % 10)) {
if (this.isFlashOn) {
- this.isFlashOn = false;
- } else {
- this.isFlashOn = true;
+ ctx.fillStyle = "#000";
+ ctx.beginPath();
+ ctx.arc(this.position.x, this.position.y, this.radius, 0, 2 * Math.PI);
+ ctx.fill();
+ //draw clock on timer
+ ctx.fillStyle = "#f04";
+ ctx.beginPath();
+ ctx.arc(this.position.x, this.position.y, this.radius * 0.5, 0, 2 * Math.PI);
+ ctx.fill();
}
}
- if (this.isFlashOn) {
- ctx.fillStyle = "#000";
- ctx.beginPath();
- ctx.arc(this.position.x, this.position.y, this.radius, 0, 2 * Math.PI);
- ctx.fill();
- //draw clock on timer
- ctx.fillStyle = "#f12";
- ctx.beginPath();
- ctx.arc(this.position.x, this.position.y, this.radius * (1 - (this.endCycle - game.cycle) / this.endCycleLength), 0, 2 * Math.PI);
- ctx.fill();
- }
- };
+ }
}
},
{
name: "spores",
- description: "release an orb that discharges spores after 2 seconds
spores seek out targets
spores can pass through blocks",
+ description: "release an orb that discharges spores after 2 seconds
spores seek out targets
spores can pass through blocks",
ammo: 0,
ammoPack: 5,
have: false,
@@ -1314,7 +1152,7 @@ const b = {
},
{
name: "drones",
- description: "release drones that seek out targets
if no targets, drones move to mouse
",
+ description: "release drones that seek out targets
if no targets are found, drones move towards mouse
",
ammo: 0,
ammoPack: 20,
have: false,
diff --git a/js/game.js b/js/game.js
index acd5d0d..9efffbd 100644
--- a/js/game.js
+++ b/js/game.js
@@ -1,6 +1,15 @@
// game Object ********************************************************
//*********************************************************************
const game = {
+ // difficulty: {
+ // damageDone: 1,
+ // damageTaken: 1,
+ // mobQuickness: 1,
+ // powerUpDropRate: 1,
+ // fallingDamage: false,
+ // explosiveDamage: true,
+ // unlimitedAmmo: false,
+ // },
loop() {
game.cycle++; //tracks game cycles
mech.cycle++; //tracks player cycles //used to alow time to stop for everything, but the player
@@ -710,13 +719,12 @@ const game = {
}
},
mapFill: "#444",
- bodyFill: "#999",
+ bodyFill: "rgba(140,140,140,0.85)", //"#999",
bodyStroke: "#222",
drawMapPath() {
ctx.fillStyle = this.mapFill;
ctx.fill(this.mapPath);
},
-
seeEdges() {
const eye = {
x: mech.pos.x + 20 * Math.cos(mech.angle),
diff --git a/js/index.js b/js/index.js
index a50d567..4ff60d5 100644
--- a/js/index.js
+++ b/js/index.js
@@ -2,7 +2,19 @@
/* TODO: *******************************************
*****************************************************
-make power ups keep moving to player if the field is turned off
+add Boss levels
+
+
+add modular difficulty settings
+ take reduced dmg
+ slower mob look / CD
+ more drops
+ fewer mobs
+ make a new var to scale number of mobs and stop using levels cleared var
+
+get text output to show multiple notifications at once by queuing them vertically
+
+make power ups keep moving to player if the pickup field is turned off before they get picked up
not sure how to do this without adding a constant check
levels spawn by having the map aspects randomly fly into place
diff --git a/js/level.js b/js/level.js
index 59b8e31..cd7d819 100644
--- a/js/level.js
+++ b/js/level.js
@@ -14,7 +14,7 @@ const level = {
if (game.levelsCleared === 0) {
// game.levelsCleared = 16; //for testing to simulate possible mobs spawns
// b.giveGuns("all", 1000)
- // b.giveGuns(3) // set a starting gun for testing
+ // b.giveGuns(9) // set a starting gun for testing
// mech.fieldUpgrades[2].effect(); //give a field power up for testing
// b.giveMod(8)
@@ -36,8 +36,8 @@ const level = {
game.draw.setPaths();
},
difficultyIncrease() {
- game.dmgScale += 0.35; //damage done by mobs increases each level
- b.dmgScale *= 0.92; //damage done by player decreases each level
+ game.dmgScale += 0.3; //damage done by mobs increases each level
+ b.dmgScale *= 0.94; //damage done by player decreases each level
game.accelScale *= 1.05 //mob acceleration increases each level
game.lookFreqScale *= 0.95 //mob cycles between looks decreases each level
game.CDScale *= 0.95 //mob CD time decreases each level
@@ -122,7 +122,8 @@ const level = {
// spawn.bodyRect(-45, -100, 40, 50);
// spawn.focuser(800, -1150);
// spawn.groupBoss(-600, -550);
- spawn.starter(800, -150, 100);
+ spawn.striker(800, -150);
+ // spawn.beamer(800, -150);
// spawn.grower(800, -250);
// spawn.blinker(800, -250, 40);
// spawn.groupBoss(900, -1070);
@@ -797,7 +798,7 @@ const level = {
spawn.mapRect(1600, -400, 1500, 500); //long center building
spawn.mapRect(1345, -1100, 250, 25); //left platform
spawn.mapRect(1755, -1100, 250, 25); //right platform
- spawn.mapRect(1300, -1850, 750, 50); //left higher platform
+ spawn.mapRect(1300, -1850, 780, 50); //left higher platform
spawn.mapRect(1300, -2150, 50, 350); //left higher platform left edge wall
spawn.mapRect(1300, -2150, 450, 50); //left higher platform roof
spawn.mapRect(1500, -1860, 100, 50); //ground bump wall
@@ -1554,7 +1555,7 @@ const level = {
},
levelAnnounce() {
document.title = "n-gon: L" + (game.levelsCleared) + " " + level.levels[level.onLevel];
- game.makeTextLog(`
${mech.fieldUpgrades[mech.fieldMode].description}
`, 1200); + game.makeTextLog(`${mech.fieldUpgrades[mech.fieldMode].name}${b.mods[newMod].description}
`, 1200); + game.makeTextLog(`${b.mods[newMod].name}${b.guns[newGun].description}
`, 1000); + if (b.activeGun === null) b.activeGun = newGun //if no active gun switch to new gun + game.makeTextLog(`${b.guns[newGun].name}