game balance - foam,harmonic field, laser mob
This commit is contained in:
@@ -94,8 +94,6 @@
|
|||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="settings">
|
<div id="settings">
|
||||||
<details>
|
<details>
|
||||||
<summary>settings</summary>
|
<summary>settings</summary>
|
||||||
|
|||||||
@@ -1731,7 +1731,7 @@ const b = {
|
|||||||
name: "foam", //15
|
name: "foam", //15
|
||||||
description: "spray bubbly foam that <strong>sticks</strong> to enemies<br>does <strong class='color-d'>damage</strong> over time and <strong>slows</strong> movement",
|
description: "spray bubbly foam that <strong>sticks</strong> to enemies<br>does <strong class='color-d'>damage</strong> over time and <strong>slows</strong> movement",
|
||||||
ammo: 0,
|
ammo: 0,
|
||||||
ammoPack: 95,
|
ammoPack: 90,
|
||||||
have: false,
|
have: false,
|
||||||
isStarterGun: true,
|
isStarterGun: true,
|
||||||
fire() {
|
fire() {
|
||||||
@@ -1788,22 +1788,22 @@ const b = {
|
|||||||
if (this.count < 17) {
|
if (this.count < 17) {
|
||||||
this.count++
|
this.count++
|
||||||
//grow
|
//grow
|
||||||
const SCALE = 1.1
|
const SCALE = 1.08
|
||||||
Matter.Body.scale(this, SCALE, SCALE);
|
Matter.Body.scale(this, SCALE, SCALE);
|
||||||
this.radius *= SCALE;
|
this.radius *= SCALE;
|
||||||
} else {
|
} else {
|
||||||
//shrink
|
//shrink
|
||||||
const SCALE = 1 - 0.006 / b.isModBulletsLastLonger
|
const SCALE = 1 - 0.0035 / b.isModBulletsLastLonger
|
||||||
Matter.Body.scale(this, SCALE, SCALE);
|
Matter.Body.scale(this, SCALE, SCALE);
|
||||||
this.radius *= SCALE;
|
this.radius *= SCALE;
|
||||||
if (this.radius < 11) this.endCycle = 0;
|
if (this.radius < 14) this.endCycle = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.target && this.target.alive) { //if stuck to a target
|
if (this.target && this.target.alive) { //if stuck to a target
|
||||||
Matter.Body.setPosition(this, this.target.vertices[this.targetVertex])
|
Matter.Body.setPosition(this, this.target.vertices[this.targetVertex])
|
||||||
Matter.Body.setVelocity(this.target, Matter.Vector.mult(this.target.velocity, 0.94))
|
Matter.Body.setVelocity(this.target, Matter.Vector.mult(this.target.velocity, 0.94))
|
||||||
Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.94)
|
Matter.Body.setAngularVelocity(this.target, this.target.angularVelocity * 0.94)
|
||||||
this.target.damage(b.dmgScale * 0.0025);
|
this.target.damage(b.dmgScale * 0.004);
|
||||||
} else if (this.target !== null) { //look for a new target
|
} else if (this.target !== null) { //look for a new target
|
||||||
this.target = null
|
this.target = null
|
||||||
this.collisionFilter.category = cat.bullet;
|
this.collisionFilter.category = cat.bullet;
|
||||||
@@ -1813,8 +1813,8 @@ const b = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
World.add(engine.world, bullet[me]); //add bullet to world
|
World.add(engine.world, bullet[me]); //add bullet to world
|
||||||
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 15 : 4) * b.modFireRate); // cool down
|
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 12 : 4) * b.modFireRate); // cool down
|
||||||
const SPEED = mech.crouch ? 20 : 14 - RADIUS * 0.25;
|
const SPEED = mech.crouch ? 22 : 12 - RADIUS * 0.25;
|
||||||
Matter.Body.setVelocity(bullet[me], {
|
Matter.Body.setVelocity(bullet[me], {
|
||||||
x: SPEED * Math.cos(dir),
|
x: SPEED * Math.cos(dir),
|
||||||
y: SPEED * Math.sin(dir)
|
y: SPEED * Math.sin(dir)
|
||||||
|
|||||||
15
js/index.js
15
js/index.js
@@ -98,21 +98,6 @@ game mechanics
|
|||||||
low friction ground
|
low friction ground
|
||||||
bouncy ground
|
bouncy ground
|
||||||
|
|
||||||
|
|
||||||
// collision info:
|
|
||||||
category mask
|
|
||||||
powerUp: 0x100000 0x100001
|
|
||||||
body: 0x010000 0x011111
|
|
||||||
player: 0x001000 0x010011
|
|
||||||
bullet: 0x000100 0x010011
|
|
||||||
mob: 0x000010 0x011111
|
|
||||||
mobBullet: 0x000010 0x011101
|
|
||||||
mobShield: 0x000010 0x001100
|
|
||||||
map: 0x000001 0x111111
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
//collision groups
|
//collision groups
|
||||||
// cat.player | cat.map | cat.body | cat.bullet | cat.powerUp | cat.mob | cat.mobBullet | cat.mobShield
|
// cat.player | cat.map | cat.body | cat.bullet | cat.powerUp | cat.mob | cat.mobBullet | cat.mobShield
|
||||||
|
|||||||
@@ -362,9 +362,9 @@ const mobs = {
|
|||||||
// hitting player
|
// hitting player
|
||||||
if (best.who === player) {
|
if (best.who === player) {
|
||||||
if (b.isModTempResist) {
|
if (b.isModTempResist) {
|
||||||
dmg = 0.0008 * game.dmgScale;
|
dmg = 0.0004 * game.dmgScale;
|
||||||
} else {
|
} else {
|
||||||
dmg = 0.004 * game.dmgScale;
|
dmg = 0.002 * game.dmgScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
mech.damage(dmg);
|
mech.damage(dmg);
|
||||||
|
|||||||
48
js/player.js
48
js/player.js
@@ -849,31 +849,29 @@ const mech = {
|
|||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
},
|
},
|
||||||
grabPowerUp() { //look for power ups to grab with field
|
grabPowerUp() { //look for power ups to grab with field
|
||||||
if (mech.fieldCDcycle < mech.cycle) {
|
const grabPowerUpRange2 = (mech.grabRange + 220) * (mech.grabRange + 220)
|
||||||
const grabPowerUpRange2 = (mech.grabRange + 220) * (mech.grabRange + 220)
|
for (let i = 0, len = powerUp.length; i < len; ++i) {
|
||||||
for (let i = 0, len = powerUp.length; i < len; ++i) {
|
const dxP = mech.pos.x - powerUp[i].position.x;
|
||||||
const dxP = mech.pos.x - powerUp[i].position.x;
|
const dyP = mech.pos.y - powerUp[i].position.y;
|
||||||
const dyP = mech.pos.y - powerUp[i].position.y;
|
const dist2 = dxP * dxP + dyP * dyP;
|
||||||
const dist2 = dxP * dxP + dyP * dyP;
|
// float towards player if looking at and in range or if very close to player
|
||||||
// float towards player if looking at and in range or if very close to player
|
if (dist2 < grabPowerUpRange2 && mech.lookingAt(powerUp[i]) || dist2 < 16000) {
|
||||||
if (dist2 < grabPowerUpRange2 && mech.lookingAt(powerUp[i]) || dist2 < 16000) {
|
if (dist2 < 5000) { //use power up if it is close enough
|
||||||
if (dist2 < 5000) { //use power up if it is close enough
|
Matter.Body.setVelocity(player, { //player knock back, after grabbing power up
|
||||||
Matter.Body.setVelocity(player, { //player knock back, after grabbing power up
|
x: player.velocity.x + ((powerUp[i].velocity.x * powerUp[i].mass) / player.mass) * 0.3,
|
||||||
x: player.velocity.x + ((powerUp[i].velocity.x * powerUp[i].mass) / player.mass) * 0.3,
|
y: player.velocity.y + ((powerUp[i].velocity.y * powerUp[i].mass) / player.mass) * 0.3
|
||||||
y: player.velocity.y + ((powerUp[i].velocity.y * powerUp[i].mass) / player.mass) * 0.3
|
|
||||||
});
|
|
||||||
mech.usePowerUp(i);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mech.fieldMeter -= mech.fieldRegen * 0.5;
|
|
||||||
powerUp[i].force.x += 7 * (dxP / dist2) * powerUp[i].mass;
|
|
||||||
powerUp[i].force.y += 7 * (dyP / dist2) * powerUp[i].mass - powerUp[i].mass * game.g; //negate gravity
|
|
||||||
//extra friction
|
|
||||||
Matter.Body.setVelocity(powerUp[i], {
|
|
||||||
x: powerUp[i].velocity.x * 0.11,
|
|
||||||
y: powerUp[i].velocity.y * 0.11
|
|
||||||
});
|
});
|
||||||
|
mech.usePowerUp(i);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
mech.fieldMeter -= mech.fieldRegen * 0.5;
|
||||||
|
powerUp[i].force.x += 7 * (dxP / dist2) * powerUp[i].mass;
|
||||||
|
powerUp[i].force.y += 7 * (dyP / dist2) * powerUp[i].mass - powerUp[i].mass * game.g; //negate gravity
|
||||||
|
//extra friction
|
||||||
|
Matter.Body.setVelocity(powerUp[i], {
|
||||||
|
x: powerUp[i].velocity.x * 0.11,
|
||||||
|
y: powerUp[i].velocity.y * 0.11
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1056,7 +1054,7 @@ const mech = {
|
|||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
mech.throw();
|
mech.throw();
|
||||||
} else if ((keys[32] || game.mouseDownRight && mech.fieldMeter > 0.1 && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
} else if ((keys[32] || game.mouseDownRight && mech.fieldMeter > 0.05 && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
||||||
mech.drawField();
|
mech.drawField();
|
||||||
mech.grabPowerUp();
|
mech.grabPowerUp();
|
||||||
mech.lookForPickUp();
|
mech.lookForPickUp();
|
||||||
@@ -1402,7 +1400,7 @@ const mech = {
|
|||||||
mech.fieldMode = 4;
|
mech.fieldMode = 4;
|
||||||
mech.fieldText();
|
mech.fieldText();
|
||||||
mech.setHoldDefaults();
|
mech.setHoldDefaults();
|
||||||
mech.fieldRegen *= 0.5;
|
mech.fieldRegen *= 0.6;
|
||||||
mech.fieldShieldingScale = 1.5;
|
mech.fieldShieldingScale = 1.5;
|
||||||
|
|
||||||
mech.hold = function () {
|
mech.hold = function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user