immortality bug fix, spore balance, acid balance, and graphics, UI update
This commit is contained in:
19
index.html
19
index.html
@@ -85,6 +85,7 @@
|
|||||||
<text x="10" y="30">custom</text>
|
<text x="10" y="30">custom</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
<div id='info'>
|
||||||
<div id="settings">
|
<div id="settings">
|
||||||
<details>
|
<details>
|
||||||
<summary>settings</summary>
|
<summary>settings</summary>
|
||||||
@@ -111,11 +112,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<details>
|
<details>
|
||||||
<summary>about</summary>
|
<summary>controls</summary>
|
||||||
<div id="details-div">
|
<div id="details-div">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -148,8 +147,17 @@
|
|||||||
<td>enter</td>
|
<td>enter</td>
|
||||||
</tr> -->
|
</tr> -->
|
||||||
</table>
|
</table>
|
||||||
<br>
|
</div>
|
||||||
<br>
|
</details>
|
||||||
|
</div>
|
||||||
|
<div id="controls">
|
||||||
|
<details>
|
||||||
|
<summary>about</summary>
|
||||||
|
<div id="details-div">
|
||||||
|
<!-- <p>
|
||||||
|
n-gon is a 2-D physics platformer / shooter
|
||||||
|
<br>it has
|
||||||
|
</p> -->
|
||||||
<a href="https://discord.gg/2eC9pgJ">
|
<a href="https://discord.gg/2eC9pgJ">
|
||||||
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 235">
|
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 235">
|
||||||
<style>
|
<style>
|
||||||
@@ -184,6 +192,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.fade-in {
|
.fade-in {
|
||||||
|
|||||||
130
js/bullets.js
130
js/bullets.js
@@ -73,7 +73,8 @@ const b = {
|
|||||||
description: "each <strong>bullet</strong> does extra chemical <strong class='color-d'>damage</strong><br>instant damage, unaffected by momentum",
|
description: "each <strong>bullet</strong> does extra chemical <strong class='color-d'>damage</strong><br>instant damage, unaffected by momentum",
|
||||||
have: false, //1
|
have: false, //1
|
||||||
effect: () => { //good with guns that fire many bullets at low speeds, minigun, drones, junk-bots, shotgun, superballs, wavebeam
|
effect: () => { //good with guns that fire many bullets at low speeds, minigun, drones, junk-bots, shotgun, superballs, wavebeam
|
||||||
b.modExtraDmg = 0.1
|
b.modExtraDmg = 0.25
|
||||||
|
game.playerDmgColor = "rgba(0,80,80,0.9)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -118,10 +119,10 @@ const b = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Lorentzian topology",
|
name: "Lorentzian topology",
|
||||||
description: "your <strong>bullets</strong> last 40% <strong>longer</strong>",
|
description: "your <strong>bullets</strong> last 33% <strong>longer</strong>",
|
||||||
have: false, //7
|
have: false, //7
|
||||||
effect: () => { //good with: drones, super balls, spore, missiles, wave beam(range), rapid fire(range), flak(range)
|
effect: () => { //good with: drones, super balls, spore, missiles, wave beam(range), rapid fire(range), flak(range)
|
||||||
b.isModBulletsLastLonger = 1.40
|
b.isModBulletsLastLonger = 1.33
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -129,7 +130,7 @@ const b = {
|
|||||||
description: "enemies can discharge <strong style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br><strong style='letter-spacing: 2px;'>spores</strong> seek out enemies",
|
description: "enemies can discharge <strong style='letter-spacing: 2px;'>spores</strong> on <strong>death</strong><br><strong style='letter-spacing: 2px;'>spores</strong> seek out enemies",
|
||||||
have: false, //8
|
have: false, //8
|
||||||
effect: () => { //good late game maybe?
|
effect: () => { //good late game maybe?
|
||||||
b.modSpores = 0.20;
|
b.modSpores = 0.15;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -150,17 +151,17 @@ const b = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "high explosives",
|
name: "high explosives",
|
||||||
description: "<strong class='color-e'>explosions</strong> are 50% <strong>larger</strong><br>immune to <strong>harm</strong> from <strong class='color-e'>explosions</strong>",
|
description: "<strong class='color-e'>explosions</strong> are 33% <strong>larger</strong><br>immune to <strong>harm</strong> from <strong class='color-e'>explosions</strong>",
|
||||||
have: false, //11
|
have: false, //11
|
||||||
effect: () => {
|
effect: () => {
|
||||||
b.modExplosionRadius = 1.3;
|
b.modExplosionRadius = 1.2;
|
||||||
b.isModImmuneExplosion = true;
|
b.isModImmuneExplosion = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "entanglement",
|
name: "entanglement",
|
||||||
description: "using your first gun reduces <strong>harm</strong><br>scales by <strong>7%</strong> for each gun in your inventory",
|
description: "using your first gun reduces <strong>harm</strong><br>scales by <strong>7%</strong> for each gun in your inventory",
|
||||||
have: false, //13
|
have: false, //12
|
||||||
effect: () => { // good with laser-bots
|
effect: () => { // good with laser-bots
|
||||||
b.isModEntanglement = true
|
b.isModEntanglement = true
|
||||||
}
|
}
|
||||||
@@ -168,15 +169,15 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "energy transfer",
|
name: "energy transfer",
|
||||||
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
|
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
|
||||||
have: false, //14
|
have: false, //13
|
||||||
effect: () => { //good with laser, and all fields
|
effect: () => { //good with laser, and all fields
|
||||||
b.modEnergySiphon = 0.2;
|
b.modEnergySiphon = 0.18;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "entropy transfer",
|
name: "entropy transfer",
|
||||||
description: "<strong class='color-h'>heal</strong> proportional to <strong class='color-d'>damage</strong> done",
|
description: "<strong class='color-h'>heal</strong> proportional to <strong class='color-d'>damage</strong> done",
|
||||||
have: false, //15
|
have: false, //14
|
||||||
effect: () => { //good with guns that overkill: one shot, grenade
|
effect: () => { //good with guns that overkill: one shot, grenade
|
||||||
b.modHealthDrain = 0.015;
|
b.modHealthDrain = 0.015;
|
||||||
}
|
}
|
||||||
@@ -184,7 +185,7 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "overcharge",
|
name: "overcharge",
|
||||||
description: "charge <strong class='color-f'>energy</strong> <strong>33%</strong> beyond your <strong>maximum</strong>",
|
description: "charge <strong class='color-f'>energy</strong> <strong>33%</strong> beyond your <strong>maximum</strong>",
|
||||||
have: false, //16
|
have: false, //15
|
||||||
effect: () => {
|
effect: () => {
|
||||||
mech.fieldEnergyMax = 1.33
|
mech.fieldEnergyMax = 1.33
|
||||||
}
|
}
|
||||||
@@ -192,7 +193,7 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "supersaturation",
|
name: "supersaturation",
|
||||||
description: "<strong class='color-h'>heal</strong> <strong>33%</strong> beyond your <strong>max health</strong>",
|
description: "<strong class='color-h'>heal</strong> <strong>33%</strong> beyond your <strong>max health</strong>",
|
||||||
have: false, //17
|
have: false, //16
|
||||||
effect: () => {
|
effect: () => {
|
||||||
mech.maxHealth = 1.33
|
mech.maxHealth = 1.33
|
||||||
}
|
}
|
||||||
@@ -200,7 +201,7 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "recursive healing",
|
name: "recursive healing",
|
||||||
description: "<strong class='color-h'>healing</strong> power ups are twice as effective",
|
description: "<strong class='color-h'>healing</strong> power ups are twice as effective",
|
||||||
have: false, //18
|
have: false, //17
|
||||||
effect: () => { // good with ablative synthesis, melee builds
|
effect: () => { // good with ablative synthesis, melee builds
|
||||||
b.isModRecursiveHealing = true
|
b.isModRecursiveHealing = true
|
||||||
}
|
}
|
||||||
@@ -208,7 +209,7 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "mass-energy equivalence",
|
name: "mass-energy equivalence",
|
||||||
description: "convert the mass of <strong>power ups</strong> into <strong class='color-f'>energy</strong><br>power ups fill your <strong class='color-f'>energy</strong> and <strong class='color-h'>heal</strong> for +5%",
|
description: "convert the mass of <strong>power ups</strong> into <strong class='color-f'>energy</strong><br>power ups fill your <strong class='color-f'>energy</strong> and <strong class='color-h'>heal</strong> for +5%",
|
||||||
have: false, //19
|
have: false, //18
|
||||||
effect: () => {
|
effect: () => {
|
||||||
b.isModMassEnergy = true // used in mech.usePowerUp
|
b.isModMassEnergy = true // used in mech.usePowerUp
|
||||||
}
|
}
|
||||||
@@ -216,7 +217,7 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "Bayesian inference",
|
name: "Bayesian inference",
|
||||||
description: "<strong>15%</strong> chance for double <strong>power ups</strong> to drop",
|
description: "<strong>15%</strong> chance for double <strong>power ups</strong> to drop",
|
||||||
have: false, //20
|
have: false, //19
|
||||||
effect: () => { // good with long term planning
|
effect: () => { // good with long term planning
|
||||||
b.modMoreDrops = 0.15;
|
b.modMoreDrops = 0.15;
|
||||||
}
|
}
|
||||||
@@ -224,7 +225,7 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "Gauss rifle",
|
name: "Gauss rifle",
|
||||||
description: "<strong>launch blocks</strong> at much higher speeds<br><em>hold onto larger blocks even after getting hit</em>",
|
description: "<strong>launch blocks</strong> at much higher speeds<br><em>hold onto larger blocks even after getting hit</em>",
|
||||||
have: false, //21
|
have: false, //20
|
||||||
effect: () => { // good with guns that run out of ammo
|
effect: () => { // good with guns that run out of ammo
|
||||||
mech.throwChargeRate = 4;
|
mech.throwChargeRate = 4;
|
||||||
mech.throwChargeMax = 150;
|
mech.throwChargeMax = 150;
|
||||||
@@ -234,7 +235,7 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "squirrel-cage rotor",
|
name: "squirrel-cage rotor",
|
||||||
description: "<strong>jump</strong> higher and <strong>move</strong> faster<br>reduced <strong>harm</strong> from <strong>falling</strong> ",
|
description: "<strong>jump</strong> higher and <strong>move</strong> faster<br>reduced <strong>harm</strong> from <strong>falling</strong> ",
|
||||||
have: false, //22
|
have: false, //21
|
||||||
effect: () => { // good with melee builds, content skipping builds
|
effect: () => { // good with melee builds, content skipping builds
|
||||||
b.modSquirrelFx = 1.2;
|
b.modSquirrelFx = 1.2;
|
||||||
mech.Fx = 0.015 * b.modSquirrelFx;
|
mech.Fx = 0.015 * b.modSquirrelFx;
|
||||||
@@ -244,7 +245,7 @@ const b = {
|
|||||||
{
|
{
|
||||||
name: "quantum immortality",
|
name: "quantum immortality",
|
||||||
description: "after <strong>dying</strong>, continue in an <strong>alternate reality</strong><br><em>guns, ammo, and field are randomized</em>",
|
description: "after <strong>dying</strong>, continue in an <strong>alternate reality</strong><br><em>guns, ammo, and field are randomized</em>",
|
||||||
have: false, //23
|
have: false, //22
|
||||||
effect: () => {
|
effect: () => {
|
||||||
b.modIsImmortal = true;
|
b.modIsImmortal = true;
|
||||||
}
|
}
|
||||||
@@ -272,23 +273,6 @@ const b = {
|
|||||||
activeGun: null, //current gun in use by player
|
activeGun: null, //current gun in use by player
|
||||||
inventoryGun: 0,
|
inventoryGun: 0,
|
||||||
inventory: [], //list of what guns player has // 0 starts with basic gun
|
inventory: [], //list of what guns player has // 0 starts with basic gun
|
||||||
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;
|
|
||||||
b.inventory[i] = i;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!b.guns[gun].have) b.inventory.push(gun);
|
|
||||||
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun
|
|
||||||
b.guns[gun].have = true;
|
|
||||||
b.guns[gun].ammo = b.guns[gun].ammoPack * ammoPacks;
|
|
||||||
}
|
|
||||||
game.makeGunHUD();
|
|
||||||
},
|
|
||||||
fire() {
|
fire() {
|
||||||
if (game.mouseDown && mech.fireCDcycle < mech.cycle && (!(keys[32] || game.mouseDownRight) || mech.fieldFire) && b.inventory.length) {
|
if (game.mouseDown && mech.fireCDcycle < mech.cycle && (!(keys[32] || game.mouseDownRight) || mech.fieldFire) && b.inventory.length) {
|
||||||
if (b.guns[b.activeGun].ammo > 0) {
|
if (b.guns[b.activeGun].ammo > 0) {
|
||||||
@@ -362,7 +346,7 @@ const b = {
|
|||||||
angle: dir,
|
angle: dir,
|
||||||
friction: 0.5,
|
friction: 0.5,
|
||||||
frictionAir: 0,
|
frictionAir: 0,
|
||||||
dmg: b.modExtraDmg, //damage done in addition to the damage from momentum
|
dmg: 0, //damage done in addition to the damage from momentum
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
category: cat.bullet,
|
category: cat.bullet,
|
||||||
@@ -609,20 +593,20 @@ const b = {
|
|||||||
restitution: 0.5,
|
restitution: 0.5,
|
||||||
angle: Math.random() * 2 * Math.PI,
|
angle: Math.random() * 2 * Math.PI,
|
||||||
friction: 0,
|
friction: 0,
|
||||||
frictionAir: 0.02,
|
frictionAir: 0.025,
|
||||||
dmg: 1.8, //damage done in addition to the damage from momentum
|
dmg: 2.5, //damage done in addition to the damage from momentum
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
category: cat.bullet,
|
category: cat.bullet,
|
||||||
mask: cat.map | cat.mob | cat.mobBullet | cat.mobShield //no collide with body
|
mask: cat.map | cat.mob | cat.mobBullet | cat.mobShield //no collide with body
|
||||||
},
|
},
|
||||||
endCycle: game.cycle + Math.floor((360 + Math.floor(Math.random() * 240)) * b.isModBulletsLastLonger),
|
endCycle: game.cycle + Math.floor((480 + Math.floor(Math.random() * 240)) * b.isModBulletsLastLonger),
|
||||||
minDmgSpeed: 0,
|
minDmgSpeed: 0,
|
||||||
onDmg() {
|
onDmg() {
|
||||||
this.endCycle = 0; //bullet ends cycle after doing damage
|
this.endCycle = 0; //bullet ends cycle after doing damage
|
||||||
},
|
},
|
||||||
onEnd() {},
|
onEnd() {},
|
||||||
lookFrequency: 87 + Math.floor(47 * Math.random()),
|
lookFrequency: 97 + Math.floor(77 * Math.random()),
|
||||||
do() {
|
do() {
|
||||||
//find mob targets
|
//find mob targets
|
||||||
if (!(game.cycle % this.lookFrequency)) {
|
if (!(game.cycle % this.lookFrequency)) {
|
||||||
@@ -637,23 +621,24 @@ const b = {
|
|||||||
if (dist < closeDist) {
|
if (dist < closeDist) {
|
||||||
this.closestTarget = mob[i].position;
|
this.closestTarget = mob[i].position;
|
||||||
closeDist = dist;
|
closeDist = dist;
|
||||||
this.lockedOn = Vector.normalise(targetVector);
|
this.lockedOn = mob[i] //Vector.normalise(targetVector);
|
||||||
if (0.3 > Math.random()) break //doesn't always target the closest mob
|
if (0.3 > Math.random()) break //doesn't always target the closest mob
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//accelerate towards mobs
|
//accelerate towards mobs
|
||||||
const THRUST = this.mass * 0.001
|
const THRUST = 0.0004
|
||||||
if (this.lockedOn) {
|
if (this.lockedOn && this.lockedOn.alive) {
|
||||||
this.force.x -= THRUST * this.lockedOn.x
|
this.force = Vector.mult(Vector.normalise(Vector.sub(this.position, this.lockedOn.position)), -this.mass * THRUST)
|
||||||
this.force.y -= THRUST * this.lockedOn.y
|
// this.force.x -= THRUST * this.lockedOn.x
|
||||||
|
// this.force.y -= THRUST * this.lockedOn.y
|
||||||
} else {
|
} else {
|
||||||
this.force.y += this.mass * 0.00027; //gravity
|
this.force.y += this.mass * 0.00027; //gravity
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const SPEED = 19;
|
const SPEED = 8 + 3 * Math.random();
|
||||||
const ANGLE = 2 * Math.PI * Math.random()
|
const ANGLE = 2 * Math.PI * Math.random()
|
||||||
Matter.Body.setVelocity(bullet[bIndex], {
|
Matter.Body.setVelocity(bullet[bIndex], {
|
||||||
x: SPEED * Math.cos(ANGLE),
|
x: SPEED * Math.cos(ANGLE),
|
||||||
@@ -672,7 +657,7 @@ const b = {
|
|||||||
friction: 0.05,
|
friction: 0.05,
|
||||||
frictionAir: 0.0005,
|
frictionAir: 0.0005,
|
||||||
restitution: 1,
|
restitution: 1,
|
||||||
dmg: 0.13 + b.modExtraDmg, //damage done in addition to the damage from momentum
|
dmg: 0.13, //damage done in addition to the damage from momentum
|
||||||
lookFrequency: 83 + Math.floor(41 * Math.random()),
|
lookFrequency: 83 + Math.floor(41 * Math.random()),
|
||||||
endCycle: game.cycle + Math.floor((1080 + 360 * Math.random()) * b.isModBulletsLastLonger),
|
endCycle: game.cycle + Math.floor((1080 + 360 * Math.random()) * b.isModBulletsLastLonger),
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
@@ -761,6 +746,35 @@ const b = {
|
|||||||
y: speed * Math.sin(dir)
|
y: speed * Math.sin(dir)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
giveGuns(gun = "random", ammoPacks = 2) {
|
||||||
|
|
||||||
|
if (gun === "random") {
|
||||||
|
//find what guns player doesn't have
|
||||||
|
options = []
|
||||||
|
for (let i = 0, len = b.guns.length; i < len; i++) {
|
||||||
|
if (!b.guns[i].have) options.push(i)
|
||||||
|
}
|
||||||
|
if (options.length === 0) return
|
||||||
|
//randomly pick from list of possible guns
|
||||||
|
gun = options[Math.floor(Math.random() * options.length)]
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
b.inventory[i] = i;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!b.guns[gun].have) b.inventory.push(gun);
|
||||||
|
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun
|
||||||
|
b.guns[gun].have = true;
|
||||||
|
b.guns[gun].ammo = b.guns[gun].ammoPack * ammoPacks;
|
||||||
|
}
|
||||||
|
game.makeGunHUD();
|
||||||
|
},
|
||||||
guns: [{
|
guns: [{
|
||||||
name: "minigun", //0
|
name: "minigun", //0
|
||||||
description: "rapidly fire a stream of small <strong>bullets</strong>",
|
description: "rapidly fire a stream of small <strong>bullets</strong>",
|
||||||
@@ -842,7 +856,7 @@ const b = {
|
|||||||
});
|
});
|
||||||
// Matter.Body.setDensity(bullet[me], 0.0001);
|
// Matter.Body.setDensity(bullet[me], 0.0001);
|
||||||
bullet[me].endCycle = game.cycle + Math.floor(360 * b.isModBulletsLastLonger);
|
bullet[me].endCycle = game.cycle + Math.floor(360 * b.isModBulletsLastLonger);
|
||||||
bullet[me].dmg = b.modExtraDmg;
|
bullet[me].dmg = 0;
|
||||||
bullet[me].minDmgSpeed = 0;
|
bullet[me].minDmgSpeed = 0;
|
||||||
bullet[me].restitution = 0.99;
|
bullet[me].restitution = 0.99;
|
||||||
bullet[me].friction = 0;
|
bullet[me].friction = 0;
|
||||||
@@ -878,7 +892,7 @@ const b = {
|
|||||||
const me = bullet.length;
|
const me = bullet.length;
|
||||||
bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45 * b.modBulletSize, 1.4 * b.modBulletSize, b.fireAttributes(mech.angle));
|
bullet[me] = Bodies.rectangle(mech.pos.x + 40 * Math.cos(mech.angle), mech.pos.y + 40 * Math.sin(mech.angle), 45 * b.modBulletSize, 1.4 * b.modBulletSize, b.fireAttributes(mech.angle));
|
||||||
bullet[me].endCycle = game.cycle + Math.floor(180 * b.isModBulletsLastLonger);
|
bullet[me].endCycle = game.cycle + Math.floor(180 * b.isModBulletsLastLonger);
|
||||||
bullet[me].dmg = 1 + b.modExtraDmg;
|
bullet[me].dmg = 1;
|
||||||
bullet[me].do = function () {
|
bullet[me].do = function () {
|
||||||
if (this.speed < 10) this.force.y += this.mass * 0.0003; //no gravity until it slows don to improve aiming
|
if (this.speed < 10) this.force.y += this.mass * 0.0003; //no gravity until it slows don to improve aiming
|
||||||
};
|
};
|
||||||
@@ -909,7 +923,7 @@ const b = {
|
|||||||
inertia: Infinity,
|
inertia: Infinity,
|
||||||
frictionAir: 0,
|
frictionAir: 0,
|
||||||
minDmgSpeed: 0,
|
minDmgSpeed: 0,
|
||||||
dmg: 0.13 + b.modExtraDmg, //damage done in addition to the damage from momentum
|
dmg: 0.13, //damage done in addition to the damage from momentum
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
category: cat.bullet,
|
category: cat.bullet,
|
||||||
@@ -959,7 +973,7 @@ const b = {
|
|||||||
// angle: 0,
|
// angle: 0,
|
||||||
// friction: 0.5,
|
// friction: 0.5,
|
||||||
frictionAir: 0,
|
frictionAir: 0,
|
||||||
dmg: b.modExtraDmg, //damage done in addition to the damage from momentum
|
dmg: 0, //damage done in addition to the damage from momentum
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
category: 0,
|
category: 0,
|
||||||
@@ -1512,7 +1526,7 @@ const b = {
|
|||||||
Matter.Body.setVelocity(bullet[me], velocity);
|
Matter.Body.setVelocity(bullet[me], velocity);
|
||||||
World.add(engine.world, bullet[me]); //add bullet to world
|
World.add(engine.world, bullet[me]); //add bullet to world
|
||||||
bullet[me].endCycle = game.cycle + 60 + 15 * Math.random();
|
bullet[me].endCycle = game.cycle + 60 + 15 * Math.random();
|
||||||
// bullet[me].dmg = 1.1+b.modExtraDmg;
|
// bullet[me].dmg = 1.1
|
||||||
bullet[me].do = function () {};
|
bullet[me].do = function () {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1524,7 +1538,7 @@ const b = {
|
|||||||
name: "spores", //11
|
name: "spores", //11
|
||||||
description: "fire orbs that discharge <strong style='letter-spacing: 2px;'>spores</strong><br><strong style='letter-spacing: 2px;'>spores</strong> seek out enemies",
|
description: "fire orbs that discharge <strong style='letter-spacing: 2px;'>spores</strong><br><strong style='letter-spacing: 2px;'>spores</strong> seek out enemies",
|
||||||
ammo: 0,
|
ammo: 0,
|
||||||
ammoPack: 6,
|
ammoPack: 10,
|
||||||
have: false,
|
have: false,
|
||||||
isStarterGun: false,
|
isStarterGun: false,
|
||||||
fire() {
|
fire() {
|
||||||
@@ -1557,7 +1571,7 @@ const b = {
|
|||||||
|
|
||||||
//spawn bullets on end
|
//spawn bullets on end
|
||||||
bullet[me].onEnd = function () {
|
bullet[me].onEnd = function () {
|
||||||
const NUM = 9;
|
const NUM = 10;
|
||||||
for (let i = 0; i < NUM; i++) {
|
for (let i = 0; i < NUM; i++) {
|
||||||
b.spore(this)
|
b.spore(this)
|
||||||
}
|
}
|
||||||
@@ -1593,7 +1607,7 @@ const b = {
|
|||||||
friction: 0,
|
friction: 0,
|
||||||
frictionStatic: 0,
|
frictionStatic: 0,
|
||||||
restitution: 0.5 + 0.5 * Math.random(),
|
restitution: 0.5 + 0.5 * Math.random(),
|
||||||
dmg: b.modExtraDmg, // 0.14 //damage done in addition to the damage from momentum
|
dmg: 0, // 0.14 //damage done in addition to the damage from momentum
|
||||||
minDmgSpeed: 2,
|
minDmgSpeed: 2,
|
||||||
lookFrequency: 37 + Math.floor(27 * Math.random()),
|
lookFrequency: 37 + Math.floor(27 * Math.random()),
|
||||||
acceleration: 0.0015 + 0.0013 * Math.random(),
|
acceleration: 0.0015 + 0.0013 * Math.random(),
|
||||||
@@ -2261,7 +2275,7 @@ const b = {
|
|||||||
frictionAir: 0.003,
|
frictionAir: 0.003,
|
||||||
friction: 0.2,
|
friction: 0.2,
|
||||||
restitution: 0.2,
|
restitution: 0.2,
|
||||||
dmg: b.modExtraDmg, //damage done in addition to the damage from momentum
|
dmg: 0, //damage done in addition to the damage from momentum
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
category: cat.bullet,
|
category: cat.bullet,
|
||||||
@@ -2355,7 +2369,7 @@ const b = {
|
|||||||
// friction: 1,
|
// friction: 1,
|
||||||
// // frictionAir: 1,
|
// // frictionAir: 1,
|
||||||
// endCycle: game.cycle + TOTAL_CYCLES,
|
// endCycle: game.cycle + TOTAL_CYCLES,
|
||||||
// dmg: b.modExtraDmg, //damage done in addition to the damage from momentum
|
// dmg: 0, //damage done in addition to the damage from momentum
|
||||||
// classType: "bullet",
|
// classType: "bullet",
|
||||||
// collisionFilter: {
|
// collisionFilter: {
|
||||||
// category: 0x000100,
|
// category: 0x000100,
|
||||||
@@ -2448,7 +2462,7 @@ const b = {
|
|||||||
// // friction: 0.05,
|
// // friction: 0.05,
|
||||||
// // frictionAir: 0.05,
|
// // frictionAir: 0.05,
|
||||||
// restitution: 0.8,
|
// restitution: 0.8,
|
||||||
// dmg: 0.14 + b.modExtraDmg, //damage done in addition to the damage from momentum
|
// dmg: 0.14, //damage done in addition to the damage from momentum
|
||||||
// lookFrequency: 3,
|
// lookFrequency: 3,
|
||||||
// endCycle: game.cycle + Math.floor(120 * b.isModBulletsLastLonger),
|
// endCycle: game.cycle + Math.floor(120 * b.isModBulletsLastLonger),
|
||||||
// classType: "bullet",
|
// classType: "bullet",
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ function mobCollisionChecks(event) {
|
|||||||
if (obj.classType === "body" && obj.speed > 5) {
|
if (obj.classType === "body" && obj.speed > 5) {
|
||||||
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
|
const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity));
|
||||||
if (v > 8) {
|
if (v > 8) {
|
||||||
let dmg = b.dmgScale * v * Math.sqrt(obj.mass) * 0.05;
|
let dmg = b.dmgScale * (b.modExtraDmg + v * Math.sqrt(obj.mass) * 0.05);
|
||||||
mob[k].damage(dmg);
|
mob[k].damage(dmg);
|
||||||
if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer();
|
if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer();
|
||||||
game.drawList.push({
|
game.drawList.push({
|
||||||
|
|||||||
11
js/game.js
11
js/game.js
@@ -325,8 +325,7 @@ const game = {
|
|||||||
const mode = (mech.fieldMode === mech.fieldUpgrades.length - 1) ? 0 : mech.fieldMode + 1
|
const mode = (mech.fieldMode === mech.fieldUpgrades.length - 1) ? 0 : mech.fieldMode + 1
|
||||||
mech.setField(mode)
|
mech.setField(mode)
|
||||||
} else if (keys[71]) { // give all guns with G
|
} else if (keys[71]) { // give all guns with G
|
||||||
// b.giveGuns("all", 1000)
|
b.giveGuns("all", 1000)
|
||||||
powerUps.gun.effect()
|
|
||||||
} else if (keys[72]) { // heal with H
|
} else if (keys[72]) { // heal with H
|
||||||
mech.addHealth(Infinity)
|
mech.addHealth(Infinity)
|
||||||
mech.fieldMeter = mech.fieldEnergyMax;
|
mech.fieldMeter = mech.fieldEnergyMax;
|
||||||
@@ -498,10 +497,9 @@ const game = {
|
|||||||
game.startGame();
|
game.startGame();
|
||||||
};
|
};
|
||||||
document.getElementById("choose-grid").style.display = "none"
|
document.getElementById("choose-grid").style.display = "none"
|
||||||
document.getElementById("controls").style.display = "inline";
|
document.getElementById("info").style.display = "inline";
|
||||||
document.getElementById("build-button").style.display = "inline"
|
document.getElementById("build-button").style.display = "inline"
|
||||||
isShowingBuilds = false
|
isShowingBuilds = false
|
||||||
document.getElementById("settings").style.display = "inline";
|
|
||||||
document.getElementById("splash").style.display = "inline";
|
document.getElementById("splash").style.display = "inline";
|
||||||
document.getElementById("dmg").style.display = "none";
|
document.getElementById("dmg").style.display = "none";
|
||||||
document.getElementById("health-bg").style.display = "none";
|
document.getElementById("health-bg").style.display = "none";
|
||||||
@@ -515,8 +513,7 @@ const game = {
|
|||||||
document.body.style.overflow = "hidden"
|
document.body.style.overflow = "hidden"
|
||||||
document.getElementById("choose-grid").style.display = "none"
|
document.getElementById("choose-grid").style.display = "none"
|
||||||
document.getElementById("build-grid").style.display = "none"
|
document.getElementById("build-grid").style.display = "none"
|
||||||
document.getElementById("controls").style.display = "none";
|
document.getElementById("info").style.display = "none";
|
||||||
document.getElementById("settings").style.display = "none";
|
|
||||||
document.getElementById("build-button").style.display = "none";
|
document.getElementById("build-button").style.display = "none";
|
||||||
document.getElementById("splash").onclick = null; //removes the onclick effect so the function only runs once
|
document.getElementById("splash").onclick = null; //removes the onclick effect so the function only runs once
|
||||||
document.getElementById("splash").style.display = "none"; //hides the element that spawned the function
|
document.getElementById("splash").style.display = "none"; //hides the element that spawned the function
|
||||||
@@ -538,7 +535,7 @@ const game = {
|
|||||||
// // game.getCoords.pos1.y = Math.round(game.mouseInGame.y / 25) * 25;
|
// // game.getCoords.pos1.y = Math.round(game.mouseInGame.y / 25) * 25;
|
||||||
// // }
|
// // }
|
||||||
|
|
||||||
// // mech.throw();
|
// // mech.throwBlock();
|
||||||
// };
|
// };
|
||||||
|
|
||||||
document.body.style.cursor = "none";
|
document.body.style.cursor = "none";
|
||||||
|
|||||||
29
js/index.js
29
js/index.js
@@ -94,7 +94,7 @@ game mechanics
|
|||||||
|
|
||||||
// local storage
|
// local storage
|
||||||
let localSettings = JSON.parse(localStorage.getItem("localSettings"));
|
let localSettings = JSON.parse(localStorage.getItem("localSettings"));
|
||||||
|
// console.log(localSettings)
|
||||||
if (localSettings) {
|
if (localSettings) {
|
||||||
game.isBodyDamage = localSettings.isBodyDamage
|
game.isBodyDamage = localSettings.isBodyDamage
|
||||||
document.getElementById("body-damage").checked = localSettings.isBodyDamage
|
document.getElementById("body-damage").checked = localSettings.isBodyDamage
|
||||||
@@ -102,9 +102,12 @@ if (localSettings) {
|
|||||||
game.difficultyMode = localSettings.difficultyMode
|
game.difficultyMode = localSettings.difficultyMode
|
||||||
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
||||||
|
|
||||||
game.fpsCapDefault = localSettings.fpsCapDefault
|
if (localSettings.fpsCapDefault === 'max') {
|
||||||
|
game.fpsCapDefault = 999999999;
|
||||||
|
} else {
|
||||||
|
game.fpsCapDefault = Number(localSettings.fpsCapDefault)
|
||||||
|
}
|
||||||
document.getElementById("fps-select").value = localSettings.fpsCapDefault
|
document.getElementById("fps-select").value = localSettings.fpsCapDefault
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
localSettings = {
|
localSettings = {
|
||||||
isBodyDamage: true,
|
isBodyDamage: true,
|
||||||
@@ -192,8 +195,7 @@ document.getElementById("build-button").addEventListener("click", () => {
|
|||||||
el.style.display = "none"
|
el.style.display = "none"
|
||||||
build.isShowingBuilds = false
|
build.isShowingBuilds = false
|
||||||
document.body.style.overflow = "hidden"
|
document.body.style.overflow = "hidden"
|
||||||
document.getElementById("controls").style.display = 'inline'
|
document.getElementById("info").style.display = 'inline'
|
||||||
document.getElementById("settings").style.display = 'inline'
|
|
||||||
} else {
|
} else {
|
||||||
build.list = []
|
build.list = []
|
||||||
// let text = '<p>choose up to 5 powers<br> <button type="button" id="build-begin-button" onclick="build.startBuildRun()">Begin Run</button></p>'
|
// let text = '<p>choose up to 5 powers<br> <button type="button" id="build-begin-button" onclick="build.startBuildRun()">Begin Run</button></p>'
|
||||||
@@ -222,8 +224,7 @@ document.getElementById("build-button").addEventListener("click", () => {
|
|||||||
build.isShowingBuilds = true
|
build.isShowingBuilds = true
|
||||||
document.body.style.overflowY = "scroll";
|
document.body.style.overflowY = "scroll";
|
||||||
document.body.style.overflowX = "hidden";
|
document.body.style.overflowX = "hidden";
|
||||||
document.getElementById("controls").style.display = 'none'
|
document.getElementById("info").style.display = 'none'
|
||||||
document.getElementById("settings").style.display = 'none'
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -305,18 +306,10 @@ document.getElementById("fps-select").addEventListener("input", () => {
|
|||||||
let value = document.getElementById("fps-select").value
|
let value = document.getElementById("fps-select").value
|
||||||
if (value === 'max') {
|
if (value === 'max') {
|
||||||
game.fpsCapDefault = 999999999;
|
game.fpsCapDefault = 999999999;
|
||||||
} else if (value === '72') {
|
} else {
|
||||||
game.fpsCapDefault = 72
|
game.fpsCapDefault = Number(value)
|
||||||
} else if (value === '60') {
|
|
||||||
game.fpsCapDefault = 60
|
|
||||||
} else if (value === '45') {
|
|
||||||
game.fpsCapDefault = 45
|
|
||||||
} else if (value === '30') {
|
|
||||||
game.fpsCapDefault = 30
|
|
||||||
} else if (value === '15') {
|
|
||||||
game.fpsCapDefault = 15
|
|
||||||
}
|
}
|
||||||
localSettings.fpsCapDefault = game.fpsCapDefault
|
localSettings.fpsCapDefault = value
|
||||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
10
js/level.js
10
js/level.js
@@ -14,9 +14,9 @@ const level = {
|
|||||||
start() {
|
start() {
|
||||||
if (level.levelsCleared === 0) {
|
if (level.levelsCleared === 0) {
|
||||||
// game.difficulty = 6; //for testing to simulate possible mobs spawns
|
// game.difficulty = 6; //for testing to simulate possible mobs spawns
|
||||||
// b.giveGuns(3)
|
// b.giveGuns(21)
|
||||||
// mech.fieldUpgrades[2].effect();
|
// mech.fieldUpgrades[2].effect();
|
||||||
// b.giveMod(21)
|
// b.giveMod(22)
|
||||||
|
|
||||||
level.intro(); //starting level
|
level.intro(); //starting level
|
||||||
// level.testingMap();
|
// level.testingMap();
|
||||||
@@ -119,10 +119,10 @@ const level = {
|
|||||||
// powerUps.spawn(450, -400, "mod", false);
|
// powerUps.spawn(450, -400, "mod", false);
|
||||||
// spawn.bodyRect(-45, -100, 40, 50);
|
// spawn.bodyRect(-45, -100, 40, 50);
|
||||||
// spawn.groupBoss(800, -1050);
|
// spawn.groupBoss(800, -1050);
|
||||||
spawn.spinner(400, -1050);
|
spawn.starter(400, -1050);
|
||||||
spawn.spinner(1200, -1050);
|
spawn.starter(1200, -1050);
|
||||||
// spawn.groupBoss(-600, -550);
|
// spawn.groupBoss(-600, -550);
|
||||||
spawn.spinner(800, -150);
|
spawn.starter(800, -150);
|
||||||
// spawn.beamer(800, -150);
|
// spawn.beamer(800, -150);
|
||||||
// spawn.grower(800, -250);
|
// spawn.grower(800, -250);
|
||||||
// spawn.blinker(800, -250, 40);
|
// spawn.blinker(800, -250, 40);
|
||||||
|
|||||||
34
js/player.js
34
js/player.js
@@ -328,9 +328,9 @@ const mech = {
|
|||||||
|
|
||||||
function randomizeField() {
|
function randomizeField() {
|
||||||
if (game.difficulty * (Math.random() + 0.27) > 2) {
|
if (game.difficulty * (Math.random() + 0.27) > 2) {
|
||||||
mech.fieldUpgrades[Math.floor(Math.random() * (mech.fieldUpgrades.length))].effect();
|
mech.setField(Math.floor(Math.random() * (mech.fieldUpgrades.length)))
|
||||||
} else {
|
} else {
|
||||||
mech.fieldUpgrades[0].effect();
|
mech.setField(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,8 +350,10 @@ const mech = {
|
|||||||
b.guns[i].have = false;
|
b.guns[i].have = false;
|
||||||
if (b.guns[i].ammo !== Infinity) b.guns[i].ammo = 0;
|
if (b.guns[i].ammo !== Infinity) b.guns[i].ammo = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//give random guns
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
powerUps.gun.effect();
|
b.giveGuns()
|
||||||
}
|
}
|
||||||
|
|
||||||
//randomize ammo
|
//randomize ammo
|
||||||
@@ -746,10 +748,9 @@ const mech = {
|
|||||||
Matter.Body.rotate(mech.holdingTarget, 0.01 / mech.holdingTarget.mass); //gently spin the block
|
Matter.Body.rotate(mech.holdingTarget, 0.01 / mech.holdingTarget.mass); //gently spin the block
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
throw () {
|
throwBlock() {
|
||||||
if ((keys[32] || game.mouseDownRight)) {
|
if (mech.holdingTarget && (keys[32] || game.mouseDownRight)) {
|
||||||
if (mech.fieldMeter > 0.0007) {
|
if (mech.fieldMeter > 0.0007) {
|
||||||
if (mech.holdingTarget) {
|
|
||||||
mech.fieldMeter -= 0.0007;
|
mech.fieldMeter -= 0.0007;
|
||||||
mech.throwCharge += mech.throwChargeRate;;
|
mech.throwCharge += mech.throwChargeRate;;
|
||||||
//draw charge
|
//draw charge
|
||||||
@@ -773,7 +774,6 @@ const mech = {
|
|||||||
ctx.lineTo(mech.holdingTarget.vertices[i + 1].x, mech.holdingTarget.vertices[i + 1].y);
|
ctx.lineTo(mech.holdingTarget.vertices[i + 1].x, mech.holdingTarget.vertices[i + 1].y);
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
mech.drop()
|
mech.drop()
|
||||||
}
|
}
|
||||||
@@ -1052,7 +1052,7 @@ const mech = {
|
|||||||
if (mech.isHolding) {
|
if (mech.isHolding) {
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
mech.throw();
|
mech.throwBlock();
|
||||||
} else if ((keys[32] || game.mouseDownRight && mech.fieldMeter > 0.05 && 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();
|
||||||
@@ -1079,7 +1079,7 @@ const mech = {
|
|||||||
mech.wakeCheck();
|
mech.wakeCheck();
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
mech.throw();
|
mech.throwBlock();
|
||||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
||||||
const DRAIN = 0.0023
|
const DRAIN = 0.0023
|
||||||
if (mech.fieldMeter > DRAIN) {
|
if (mech.fieldMeter > DRAIN) {
|
||||||
@@ -1145,7 +1145,7 @@ const mech = {
|
|||||||
if (mech.isHolding) {
|
if (mech.isHolding) {
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
mech.throw();
|
mech.throwBlock();
|
||||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //not hold but field button is pressed
|
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //not hold but field button is pressed
|
||||||
const DRAIN = 0.0005
|
const DRAIN = 0.0005
|
||||||
if (mech.fieldMeter > DRAIN) {
|
if (mech.fieldMeter > DRAIN) {
|
||||||
@@ -1309,7 +1309,7 @@ const mech = {
|
|||||||
if (mech.isHolding) {
|
if (mech.isHolding) {
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
mech.throw();
|
mech.throwBlock();
|
||||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //push away
|
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { //push away
|
||||||
const DRAIN = 0.0004
|
const DRAIN = 0.0004
|
||||||
if (mech.fieldMeter > DRAIN) {
|
if (mech.fieldMeter > DRAIN) {
|
||||||
@@ -1394,7 +1394,7 @@ const mech = {
|
|||||||
if (mech.isHolding) {
|
if (mech.isHolding) {
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
mech.throw();
|
mech.throwBlock();
|
||||||
} else if (((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle && mech.fieldMeter > 0)) { //not hold but field button is pressed
|
} else if (((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle && mech.fieldMeter > 0)) { //not hold but field button is pressed
|
||||||
mech.grabPowerUp();
|
mech.grabPowerUp();
|
||||||
mech.lookForPickUp(180);
|
mech.lookForPickUp(180);
|
||||||
@@ -1431,15 +1431,15 @@ const mech = {
|
|||||||
effect: () => {
|
effect: () => {
|
||||||
mech.fieldRegen *= 2;
|
mech.fieldRegen *= 2;
|
||||||
mech.hold = function () {
|
mech.hold = function () {
|
||||||
if (mech.fieldMeter > mech.fieldEnergyMax - 0.02) {
|
if (mech.fieldMeter > mech.fieldEnergyMax - 0.02 && mech.fieldCDcycle < mech.cycle) {
|
||||||
|
mech.fieldCDcycle = mech.cycle + 17; // set cool down to prevent +energy from making huge numbers of drones
|
||||||
mech.fieldMeter -= 0.32;
|
mech.fieldMeter -= 0.32;
|
||||||
b.drone(1)
|
b.drone(1)
|
||||||
mech.fireCDcycle = mech.cycle + 25; // set fire cool down to prevent +energy from making huge numbers of drones
|
|
||||||
}
|
}
|
||||||
if (mech.isHolding) {
|
if (mech.isHolding) {
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
mech.throw();
|
mech.throwBlock();
|
||||||
} 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.1 && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed
|
||||||
mech.drawField();
|
mech.drawField();
|
||||||
mech.grabPowerUp();
|
mech.grabPowerUp();
|
||||||
@@ -1465,7 +1465,7 @@ const mech = {
|
|||||||
if (mech.isHolding) {
|
if (mech.isHolding) {
|
||||||
mech.drawHold(mech.holdingTarget);
|
mech.drawHold(mech.holdingTarget);
|
||||||
mech.holding();
|
mech.holding();
|
||||||
mech.throw();
|
mech.throwBlock();
|
||||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
||||||
const DRAIN = 0.0015
|
const DRAIN = 0.0015
|
||||||
if (mech.fieldMeter > DRAIN) {
|
if (mech.fieldMeter > DRAIN) {
|
||||||
@@ -1514,7 +1514,7 @@ const mech = {
|
|||||||
// mech.hackProgress = 0
|
// mech.hackProgress = 0
|
||||||
// mech.drawHold(mech.holdingTarget);
|
// mech.drawHold(mech.holdingTarget);
|
||||||
// mech.holding();
|
// mech.holding();
|
||||||
// mech.throw();
|
// mech.throwBlock();
|
||||||
// } else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
// } else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) {
|
||||||
// const DRAIN = 0.0005
|
// const DRAIN = 0.0005
|
||||||
// if (mech.fieldMeter > DRAIN) {
|
// if (mech.fieldMeter > DRAIN) {
|
||||||
|
|||||||
@@ -3,12 +3,7 @@ let powerUp = [];
|
|||||||
const powerUps = {
|
const powerUps = {
|
||||||
choose(type, index) {
|
choose(type, index) {
|
||||||
if (type === "gun") {
|
if (type === "gun") {
|
||||||
if (b.activeGun === null) b.activeGun = index //if no active gun switch to new gun
|
b.giveGuns(index)
|
||||||
b.guns[index].have = true;
|
|
||||||
b.inventory.push(index);
|
|
||||||
b.guns[index].ammo += b.guns[index].ammoPack * 2;
|
|
||||||
game.makeGunHUD();
|
|
||||||
|
|
||||||
// game.replaceTextLog = true;
|
// game.replaceTextLog = true;
|
||||||
// game.makeTextLog(`${game.SVGleftMouse} <strong style='font-size:30px;'>${b.guns[index].name}</strong><br><br>${b.guns[index].description}`, 500);
|
// game.makeTextLog(`${game.SVGleftMouse} <strong style='font-size:30px;'>${b.guns[index].name}</strong><br><br>${b.guns[index].description}`, 500);
|
||||||
// game.replaceTextLog = false;
|
// game.replaceTextLog = false;
|
||||||
|
|||||||
12
style.css
12
style.css
@@ -55,7 +55,7 @@ summary {
|
|||||||
|
|
||||||
#build-button {
|
#build-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 3px;
|
bottom: 3px;
|
||||||
right: 3px;
|
right: 3px;
|
||||||
z-index: 12;
|
z-index: 12;
|
||||||
}
|
}
|
||||||
@@ -135,15 +135,7 @@ summary {
|
|||||||
background-color: #efeff5;
|
background-color: #efeff5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#settings {
|
#info {
|
||||||
position: absolute;
|
|
||||||
bottom: 0px;
|
|
||||||
right: 1px;
|
|
||||||
z-index: 12;
|
|
||||||
font-size: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#controls {
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
left: 1px;
|
left: 1px;
|
||||||
|
|||||||
Reference in New Issue
Block a user