diff --git a/js/level.js b/js/level.js
index f4661c4..5678d64 100644
--- a/js/level.js
+++ b/js/level.js
@@ -24,7 +24,7 @@ const level = {
// game.levelsCleared = 3; //for testing to simulate possible mobs spawns
// b.giveGuns(0) // set a starting gun for testing
- mech.fieldUpgrades[2]() //give a field power up for testing
+ // mech.fieldUpgrades[7]() //give a field power up for testing
} else {
spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns
this[this.levels[this.onLevel]](); //picks the current map from the the levels array
diff --git a/js/player.js b/js/player.js
index 65d3420..b937159 100644
--- a/js/player.js
+++ b/js/player.js
@@ -830,7 +830,7 @@ const mech = {
mech.holding();
mech.throw();
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < game.cycle) {
- const DRAIN = 0.0035 //mech.fieldRegen = 0.0015
+ const DRAIN = 0.002 //mech.fieldRegen = 0.0015
if (mech.fieldMeter > DRAIN) {
mech.fieldMeter -= DRAIN;
mech.grabPowerUp();
@@ -879,12 +879,12 @@ const mech = {
mech.setHoldDefaults();
//throw quicker and harder
mech.throwChargeRate = 3; //0.5
- mech.throwChargeMax = 150; //50
+ mech.throwChargeMax = 140; //50
//passive field does extra damage
mech.fieldDamage = 2;
// const startingArc = 0.
- mech.fieldArc = 0.05
+ mech.fieldArc = 0.09
const STARTING_RANGE = 30
mech.grabRange = STARTING_RANGE;
@@ -896,7 +896,7 @@ const mech = {
} else if ((keys[32] || game.mouseDownRight) && mech.fieldMeter > 0.15) { //not hold but field button is pressed
//smoothing function to grow range
- mech.grabRange = mech.grabRange * 0.94 + 200 * 0.06
+ mech.grabRange = mech.grabRange * 0.94 + 12 //200 * 0.08
//draw field
const range = mech.grabRange - 20;
@@ -907,16 +907,18 @@ const mech = {
if (mech.holdingTarget) {
ctx.fillStyle = "rgba(255,50,150," + (0.05 + 0.1 * Math.random()) + ")";
} else {
- ctx.fillStyle = "rgba(255,50,150," + (0.15 + 0.15 * Math.random()) + ")";
+ ctx.fillStyle = "rgba(255,50,150," + (0.13 + 0.18 * Math.random()) + ")";
}
ctx.fill();
//draw random lines in field for cool effect
- let offAngle = mech.angle + 2 * Math.PI * mech.fieldArc * (Math.random() - 0.5);
- ctx.beginPath();
eye = 15;
+
+ ctx.beginPath();
ctx.moveTo(mech.pos.x + eye * Math.cos(mech.angle), mech.pos.y + eye * Math.sin(mech.angle));
+ const offAngle = mech.angle + 2 * Math.PI * mech.fieldArc * (Math.random() - 0.5);
ctx.lineTo(mech.pos.x + range * Math.cos(offAngle), mech.pos.y + range * Math.sin(offAngle));
- ctx.strokeStyle = "rgba(120,170,255,0.4)";
+ ctx.strokeStyle = "rgba(100,20,50,0.2)";
+ // ctx.strokeStyle = "rgba(0,0,0,0.4)";
ctx.stroke();
mech.grabPowerUp();
@@ -938,8 +940,8 @@ const mech = {
mech.setHoldDefaults();
mech.holdingMassScale = 0.05; //can hold heavier blocks with lower cost to jumping
// mech.fieldArc = 1; //field covers full 360 degrees
- mech.grabRange = 155;
- mech.fieldArc = 0.08;
+ // mech.grabRange = 150;
+ mech.fieldArc = 1 //0.08;
mech.calculateFieldThreshold();
mech.hold = function () {
@@ -949,22 +951,23 @@ const mech = {
mech.holding();
mech.throw();
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < game.cycle) { //push away
- const DRAIN = 0.0006 //mech.fieldRegen = 0.0015
+ const DRAIN = 0.0005 //mech.fieldRegen = 0.0015
if (mech.fieldMeter > DRAIN) {
mech.fieldMeter -= DRAIN;
- //draw field
- ctx.beginPath();
- ctx.arc(this.pos.x, this.pos.y, this.grabRange - 20, this.angle - Math.PI * this.fieldArc, this.angle + Math.PI * this.fieldArc, false);
- let eye = 13;
- ctx.lineTo(mech.pos.x + eye * Math.cos(this.angle), mech.pos.y + eye * Math.sin(this.angle));
- if (this.holdingTarget) {
- ctx.fillStyle = "rgba(150,150,150," + (0.05 + 0.1 * Math.random()) + ")";
- } else {
- ctx.fillStyle = "rgba(150,150,150," + (0.15 + 0.15 * Math.random()) + ")";
- }
- ctx.fill();
-
+ // //draw field
+ // ctx.beginPath();
+ // ctx.arc(this.pos.x, this.pos.y, this.grabRange - 20, this.angle - Math.PI * this.fieldArc, this.angle + Math.PI * this.fieldArc, false);
+ // let eye = 13;
+ // ctx.lineTo(mech.pos.x + eye * Math.cos(this.angle), mech.pos.y + eye * Math.sin(this.angle));
+ // if (this.holdingTarget) {
+ // ctx.fillStyle = "rgba(150,150,150," + (0.05 + 0.1 * Math.random()) + ")";
+ // } else {
+ // ctx.fillStyle = "rgba(150,150,150," + (0.15 + 0.15 * Math.random()) + ")";
+ // }
+ // ctx.fill();
+ // mech.drawField();
+ // mech.pushMobs();
mech.grabPowerUp();
mech.lookForPickUp();
//look for nearby objects to make zero-g
@@ -973,7 +976,7 @@ const mech = {
sub = Matter.Vector.sub(who[i].position, mech.pos);
dist = Matter.Vector.magnitude(sub);
if (dist < range) {
- who[i].force.y -= who[i].mass * (game.g * 1.03); //add a bit more then standard gravity
+ who[i].force.y -= who[i].mass * (game.g * 1.06); //add a bit more then standard gravity
}
}
}
@@ -990,13 +993,13 @@ const mech = {
player.force.y += flyForce
Matter.Body.setVelocity(player, { //friction, only when flying
x: player.velocity.x,
- y: player.velocity.y * 0.96
+ y: player.velocity.y * 0.97
});
} else if (keys[87] || keys[38]) { //up
player.force.y -= flyForce
Matter.Body.setVelocity(player, { //friction, only when flying
x: player.velocity.x,
- y: player.velocity.y * 0.96
+ y: player.velocity.y * 0.95
});
// mech.fieldMeter -= DRAIN; //extra energy used to fly upwards
}
@@ -1012,13 +1015,11 @@ const mech = {
//draw zero-G range
ctx.beginPath();
ctx.arc(mech.pos.x, mech.pos.y + 15, range, 0, 2 * Math.PI);
- ctx.globalCompositeOperation = "color-burn";
- ctx.fillStyle = "rgb(120,120,130)";
+ ctx.fillStyle = "rgba(150,160,180," + (0.3 + 0.1 * Math.random()) + ")";
ctx.fill();
- ctx.globalCompositeOperation = "source-over";
-
- // mech.drawField();
- // mech.pushMobs();
+ ctx.strokeStyle = "#000"
+ ctx.lineWidth = 2;
+ ctx.stroke();
} else {
//trigger cool down
mech.fieldCDcycle = game.cycle + 120;
@@ -1086,12 +1087,13 @@ const mech = {
if (this.holdingTarget) {
ctx.fillStyle = "rgba(150,150,150," + (0.05 + 0.1 * Math.random()) + ")";
} else {
- ctx.fillStyle = "rgba(150,150,150," + (0.15 + 0.15 * Math.random()) + ")";
+ ctx.fillStyle = "rgba(150,150,150," + (0.12 + 0.06 * Math.random()) + ")";
}
ctx.fill();
- mech.grabPowerUp();
// mech.pushMobs();
+ // mech.drawField();
+ mech.grabPowerUp();
mech.lookForPickUp();
} else if (mech.holdingTarget && mech.fireCDcycle < game.cycle) { //holding, but field button is released
mech.pickUp();
@@ -1103,10 +1105,10 @@ const mech = {
},
() => {
mech.fieldMode = 6;
- game.makeTextLog("Metamaterial Refractive Optics
(right mouse or space bar)
localized invisibility field
", 1200); + game.makeTextLog("Metamaterial Refractive Opticslocalized invisibility field
after shielding player field drains to zero