more balancing

This commit is contained in:
landgreen
2019-10-04 06:50:53 -07:00
parent 7eacaf7caa
commit e81850d644
3 changed files with 22 additions and 18 deletions

View File

@@ -548,9 +548,9 @@ const b = {
} else { } 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)); 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].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); b.drawOneBullet(bullet[me].vertices);
bullet[me].do = function () { bullet[me].do = function () {
//low gravity //low gravity

View File

@@ -24,7 +24,7 @@ const level = {
// game.levelsCleared = 3; //for testing to simulate possible mobs spawns // game.levelsCleared = 3; //for testing to simulate possible mobs spawns
// b.giveGuns(0) // set a starting gun for testing // 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 { } else {
spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns 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 this[this.levels[this.onLevel]](); //picks the current map from the the levels array

View File

@@ -849,6 +849,7 @@ const mech = {
game.makeTextLog("<strong style='font-size:30px;'>Inertia Negation Field</strong><br> (right mouse or space bar)<p> field slows objects in range<br> <span style='color:#a00;'>decreased</span> field shielding efficiency</p>", 1200); game.makeTextLog("<strong style='font-size:30px;'>Inertia Negation Field</strong><br> (right mouse or space bar)<p> field slows objects in range<br> <span style='color:#a00;'>decreased</span> field shielding efficiency</p>", 1200);
// <br> field does <span style='color:#a00;'>not</span> shield player // <br> field does <span style='color:#a00;'>not</span> shield player
mech.setHoldDefaults(); mech.setHoldDefaults();
mech.grabRange = 900
mech.fieldShieldingScale = 12; mech.fieldShieldingScale = 12;
// mech.fieldArc = 1; //field covers full 360 degrees // mech.fieldArc = 1; //field covers full 360 degrees
// mech.calculateFieldThreshold(); //run after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob) // mech.calculateFieldThreshold(); //run after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob)
@@ -859,27 +860,27 @@ const mech = {
mech.holding(); mech.holding();
mech.throw(); mech.throw();
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < game.cycle) { } 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) { if (mech.fieldMeter > DRAIN) {
mech.fieldMeter -= DRAIN; mech.fieldMeter -= DRAIN;
mech.grabPowerUp(); mech.grabPowerUp();
// mech.pushMobs(); // mech.pushMobs();
mech.pushMobs360(); mech.pushMobs360(180);
mech.lookForPickUp(130); mech.lookForPickUp(130);
const range = 900;
//draw slow field //draw slow field
ctx.beginPath(); ctx.beginPath();
ctx.arc(mech.pos.x, mech.pos.y, range, 0, 2 * Math.PI); ctx.arc(mech.pos.x, mech.pos.y + 15, mech.grabRange, 0, 2 * Math.PI);
ctx.fillStyle = "#f5f5ff"; ctx.fillStyle = "rgba(255,255,255," + (0.5 + 0.17 * Math.random()) + ")";
ctx.globalCompositeOperation = "difference";
ctx.fill(); ctx.fill();
ctx.globalCompositeOperation = "source-over"; ctx.strokeStyle = "#000"
ctx.lineWidth = 2;
ctx.stroke();
function slow(who, friction = 0) { function slow(who, friction = 0) {
for (let i = 0, len = who.length; i < len; ++i) { for (let i = 0, len = who.length; i < len; ++i) {
dist = Matter.Vector.magnitude(Matter.Vector.sub(who[i].position, mech.pos)) 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.setAngularVelocity(who[i], who[i].angularVelocity * friction)
Matter.Body.setVelocity(who[i], { Matter.Body.setVelocity(who[i], {
x: who[i].velocity.x * friction, x: who[i].velocity.x * friction,
@@ -1014,9 +1015,9 @@ const mech = {
if (keys[83] || keys[40]) { //down if (keys[83] || keys[40]) { //down
player.force.y += 0.003 player.force.y += 0.003
mech.grabRange = mech.grabRange * 0.97 + 300 * 0.03; mech.grabRange = mech.grabRange * 0.97 + 350 * 0.03;
} else { } 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 //add extra friction for horizontal motion
@@ -1029,12 +1030,15 @@ const mech = {
//draw zero-G range //draw zero-G range
ctx.beginPath(); ctx.beginPath();
ctx.arc(mech.pos.x, mech.pos.y + 15, mech.grabRange, 0, 2 * Math.PI); ctx.arc(mech.pos.x, mech.pos.y, mech.grabRange, 0, 2 * Math.PI);
ctx.fillStyle = "rgba(150,160,180," + (0.3 + 0.1 * Math.random()) + ")"; ctx.fillStyle = "#f5f5ff";
ctx.globalCompositeOperation = "difference";
// ctx.strokeStyle = "#888"
// ctx.stroke();
ctx.fill(); ctx.fill();
ctx.strokeStyle = "#000" ctx.globalCompositeOperation = "source-over";
ctx.lineWidth = 2;
ctx.stroke();
} else { } else {
//trigger cool down //trigger cool down
mech.fieldCDcycle = game.cycle + 120; mech.fieldCDcycle = game.cycle + 120;