From e81850d6442d5645d195fdd56ef27efa363a6127 Mon Sep 17 00:00:00 2001 From: landgreen Date: Fri, 4 Oct 2019 06:50:53 -0700 Subject: [PATCH] more balancing --- js/bullets.js | 4 ++-- js/level.js | 2 +- js/player.js | 34 +++++++++++++++++++--------------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/js/bullets.js b/js/bullets.js index e3402ad..2ed43ae 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -548,9 +548,9 @@ const b = { } else { bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 31, 2, b.fireAttributes(dir)); } - b.fireProps(mech.crouch ? 50 : 20, mech.crouch ? 45 : 37, dir, me); //cd , speed + b.fireProps(mech.crouch ? 40 : 20, mech.crouch ? 45 : 37, dir, me); //cd , speed bullet[me].endCycle = game.cycle + 180; - bullet[me].dmg = mech.crouch ? 1.35 : 1; + bullet[me].dmg = mech.crouch ? 1.4 : 1; b.drawOneBullet(bullet[me].vertices); bullet[me].do = function () { //low gravity diff --git a/js/level.js b/js/level.js index a549776..3d3e3dc 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[3]() //give a field power up for testing + mech.fieldUpgrades[6]() //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 3a96d66..e41ceab 100644 --- a/js/player.js +++ b/js/player.js @@ -849,6 +849,7 @@ const mech = { game.makeTextLog("Inertia Negation Field
(right mouse or space bar)

field slows objects in range
decreased field shielding efficiency

", 1200); //
field does not shield player mech.setHoldDefaults(); + mech.grabRange = 900 mech.fieldShieldingScale = 12; // mech.fieldArc = 1; //field covers full 360 degrees // mech.calculateFieldThreshold(); //run after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob) @@ -859,27 +860,27 @@ const mech = { mech.holding(); mech.throw(); } else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < game.cycle) { - const DRAIN = 0.002 //mech.fieldRegen = 0.0015 + const DRAIN = 0.001 //mech.fieldRegen = 0.0015 if (mech.fieldMeter > DRAIN) { mech.fieldMeter -= DRAIN; mech.grabPowerUp(); // mech.pushMobs(); - mech.pushMobs360(); + mech.pushMobs360(180); mech.lookForPickUp(130); - const range = 900; //draw slow field ctx.beginPath(); - ctx.arc(mech.pos.x, mech.pos.y, range, 0, 2 * Math.PI); - ctx.fillStyle = "#f5f5ff"; - ctx.globalCompositeOperation = "difference"; + ctx.arc(mech.pos.x, mech.pos.y + 15, mech.grabRange, 0, 2 * Math.PI); + ctx.fillStyle = "rgba(255,255,255," + (0.5 + 0.17 * Math.random()) + ")"; ctx.fill(); - ctx.globalCompositeOperation = "source-over"; + ctx.strokeStyle = "#000" + ctx.lineWidth = 2; + ctx.stroke(); function slow(who, friction = 0) { for (let i = 0, len = who.length; i < len; ++i) { dist = Matter.Vector.magnitude(Matter.Vector.sub(who[i].position, mech.pos)) - if (dist < range) { + if (dist < mech.grabRange) { Matter.Body.setAngularVelocity(who[i], who[i].angularVelocity * friction) Matter.Body.setVelocity(who[i], { x: who[i].velocity.x * friction, @@ -1014,9 +1015,9 @@ const mech = { if (keys[83] || keys[40]) { //down player.force.y += 0.003 - mech.grabRange = mech.grabRange * 0.97 + 300 * 0.03; + mech.grabRange = mech.grabRange * 0.97 + 350 * 0.03; } else { - mech.grabRange = mech.grabRange * 0.97 + 500 * 0.03; + mech.grabRange = mech.grabRange * 0.97 + 650 * 0.03; } //add extra friction for horizontal motion @@ -1029,12 +1030,15 @@ const mech = { //draw zero-G range ctx.beginPath(); - ctx.arc(mech.pos.x, mech.pos.y + 15, mech.grabRange, 0, 2 * Math.PI); - ctx.fillStyle = "rgba(150,160,180," + (0.3 + 0.1 * Math.random()) + ")"; + ctx.arc(mech.pos.x, mech.pos.y, mech.grabRange, 0, 2 * Math.PI); + ctx.fillStyle = "#f5f5ff"; + ctx.globalCompositeOperation = "difference"; + // ctx.strokeStyle = "#888" + // ctx.stroke(); ctx.fill(); - ctx.strokeStyle = "#000" - ctx.lineWidth = 2; - ctx.stroke(); + ctx.globalCompositeOperation = "source-over"; + + } else { //trigger cool down mech.fieldCDcycle = game.cycle + 120;