new mods, bug fixes
mods: pocket universe, plasma field range, Hawking radiation added trackpad mode
This commit is contained in:
17
index.html
17
index.html
@@ -104,15 +104,18 @@
|
||||
</select>
|
||||
<br>
|
||||
<label for="body-damage" title="allow damage from the ground and large fast moving blocks">collision damage from blocks:</label>
|
||||
<input type="checkbox" id="body-damage" name="body-damage" checked style="width:16px; height:16px;">
|
||||
<input type="checkbox" id="body-damage" name="body-damage" checked style="width:17px; height:17px;">
|
||||
<br>
|
||||
<label for="fps-select" title="use this to slow the game down">frames per second cap:</label>
|
||||
<label for="track-pad-mode" title="remove random power ups that don't work well with a track pad">remove power ups that require aiming:</label>
|
||||
<input type="checkbox" id="track-pad-mode" name="track-pad-mode" style="width:17px; height:17px;">
|
||||
<br>
|
||||
<label for="fps-select" title="use this to slow the game down">limit frames per second:</label>
|
||||
<select name="fps-select" id="fps-select">
|
||||
<option value="max">no fps cap</option>
|
||||
<option value="72" selected>72 fps cap</option>
|
||||
<option value="60">60 fps cap</option>
|
||||
<option value="45">45 fps cap</option>
|
||||
<option value="30">30 fps cap</option>
|
||||
<option value="max" selected>no cap</option>
|
||||
<option value="72">72 fps</option>
|
||||
<option value="60">60 fps</option>
|
||||
<option value="45">45 fps</option>
|
||||
<option value="30">30 fps</option>
|
||||
</select>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
205
js/bullets.js
205
js/bullets.js
@@ -57,6 +57,7 @@ const b = {
|
||||
isModMissileField: null,
|
||||
isModFlechetteMultiShot: null,
|
||||
isModMineAmmoBack: null,
|
||||
isModPlasmaRange: null,
|
||||
isModRailNails: null,
|
||||
isModHawking: null,
|
||||
modBabyMissiles: null,
|
||||
@@ -538,22 +539,6 @@ const b = {
|
||||
b.modBlockDmg = 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "field superposition",
|
||||
description: "increase your <strong>field radius</strong> by <strong>40%</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.fieldUpgrades[mech.fieldMode].name !== "time dilation field" && mech.fieldUpgrades[mech.fieldMode].name !== "phase decoherence field"
|
||||
},
|
||||
requires: "not time dilation field<br><strong>requires</strong> not phase decoherence field",
|
||||
effect() {
|
||||
mech.fieldRange = 175 * 1.4
|
||||
},
|
||||
remove() {
|
||||
mech.fieldRange = 175;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "energy conservation",
|
||||
description: "gain <strong class='color-f'>energy</strong> proportional to <strong class='color-d'>damage</strong> done",
|
||||
@@ -672,7 +657,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "catabolism",
|
||||
description: "when you <strong>fire</strong> while <strong>out</strong> of <strong>ammo</strong><br>convert <strong>3%</strong> of current health into <strong>ammo</strong>",
|
||||
description: "gain <strong>ammo</strong> when you <strong>fire</strong> while <strong>out</strong> of <strong>ammo</strong><br>drains <strong>3%</strong> of current remaining <strong>health</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -783,7 +768,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "shotgun spin-statistics",
|
||||
description: "firing your <strong>shotgun</strong> makes you <br><strong>immune</strong> to collisions for <strong>1/2</strong> a second",
|
||||
description: "firing the <strong>shotgun</strong> makes you <br><strong>immune</strong> to collisions for <strong>1/2</strong> a second",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -799,7 +784,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "super duper",
|
||||
description: "you fire <strong>+1</strong> additional <strong>super ball</strong>",
|
||||
description: "fire <strong>+1</strong> additional <strong>super ball</strong>",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -847,7 +832,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "wave phase velocity",
|
||||
description: "your <strong>wave beam</strong> propagates faster through solids",
|
||||
description: "the <strong>wave beam</strong> propagates faster in solids",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -863,9 +848,25 @@ const b = {
|
||||
b.modWaveSpeedBody = 0.25
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "pocket universe",
|
||||
description: "<strong>wave beam</strong> bullets last <strong>4</strong> times longer<br>bullets are <strong>confined</strong> to a <strong>region</strong> around player",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return b.haveGunCheck("wave beam")
|
||||
},
|
||||
requires: "wave beam",
|
||||
effect() {
|
||||
b.isModWaveReflect = true
|
||||
},
|
||||
remove() {
|
||||
b.isModWaveReflect = false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "self-replication",
|
||||
description: "when your <strong>missiles</strong> <strong class='color-e'>explode</strong><br>they fire <strong>+1</strong> smaller <strong>missiles</strong>",
|
||||
description: "when <strong>missiles</strong> <strong class='color-e'>explode</strong><br>they fire <strong>+1</strong> smaller <strong>missiles</strong>",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -901,7 +902,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "mine reclamation",
|
||||
description: "<strong>ammo</strong> from undetonated <strong>mines</strong> is returned<br><em>at the end of a level or after 2000 second</em>",
|
||||
description: "retrieve <strong>ammo</strong> from all undetonated <strong>mines</strong><br>and <strong>20%</strong> of <strong>mines</strong> after detonation",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -917,7 +918,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "tinsellated flagella",
|
||||
description: "your <strong style='letter-spacing: 2px;'>spores</strong> accelerate <strong>33% faster</strong>",
|
||||
description: "<strong style='letter-spacing: 2px;'>spores</strong> accelerate <strong>33% faster</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -981,7 +982,7 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "specular reflection",
|
||||
description: "your <strong>laser</strong> gains <strong>+1</strong> reflection<br><strong>+33%</strong> laser <strong class='color-d'>damage</strong> and <strong class='color-f'>energy</strong> drain",
|
||||
description: "the <strong>laser</strong> gains <strong>+1</strong> reflection<br><strong>+33%</strong> laser <strong class='color-d'>damage</strong> and <strong class='color-f'>energy</strong> drain",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
@@ -1005,7 +1006,7 @@ const b = {
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.fieldUpgrades[mech.fieldMode].name === "field emitter"
|
||||
return mech.fieldUpgrades[mech.fieldMode].name === "field emitter" && !game.isEasyToAimMode
|
||||
},
|
||||
requires: "basic field emitter",
|
||||
effect() {
|
||||
@@ -1017,6 +1018,54 @@ const b = {
|
||||
if (mech.fieldUpgrades[mech.fieldMode].name === "field emitter") mech.fieldShieldingScale = b.modFieldEfficiency;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "plasma torch",
|
||||
description: "increase <strong>plasma torch's</strong> range by <strong>33%</strong>",
|
||||
maxCount: 9,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.fieldUpgrades[mech.fieldMode].name === "plasma torch"
|
||||
},
|
||||
requires: "plasma torch",
|
||||
effect() {
|
||||
b.isModPlasmaRange += 0.33;
|
||||
},
|
||||
remove() {
|
||||
b.isModPlasmaRange = 1;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Hawking radiation",
|
||||
description: "<strong>negative mass field</strong> leaks virtual particles<br>mobs inside the field take <strong class='color-d'>damage</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.fieldUpgrades[mech.fieldMode].name === "negative mass field"
|
||||
},
|
||||
requires: "negative mass field",
|
||||
effect() {
|
||||
b.isModHawking = true;
|
||||
},
|
||||
remove() {
|
||||
b.isModHawking = 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "field superposition",
|
||||
description: "increase <strong>field radii</strong> by <strong>40%</strong>",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.fieldUpgrades[mech.fieldMode].name === "standing wave harmonics"
|
||||
},
|
||||
requires: "standing wave harmonics",
|
||||
effect() {
|
||||
mech.fieldRange = 175 * 1.4
|
||||
},
|
||||
remove() {
|
||||
mech.fieldRange = 175;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "mycelium manufacturing",
|
||||
description: "<strong>nano-scale manufacturing</strong> is repurposed<br>excess <strong class='color-f'>energy</strong> used to grow <strong style='letter-spacing: 2px;'>spores</strong>",
|
||||
@@ -1049,22 +1098,6 @@ const b = {
|
||||
b.isModMissileField = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "hawking radiation",
|
||||
description: "<strong>negative mass field</strong> can no longer <strong>block</strong><br>instead it <strong class='color-d'>damages</strong> mobs within range",
|
||||
maxCount: 1,
|
||||
count: 0,
|
||||
allowed() {
|
||||
return mech.fieldUpgrades[mech.fieldMode].name === "negative mass field"
|
||||
},
|
||||
requires: "negative mass field",
|
||||
effect() {
|
||||
b.isModHawking = true;
|
||||
},
|
||||
remove() {
|
||||
b.isModHawking = false;
|
||||
}
|
||||
},
|
||||
],
|
||||
removeMod(index) {
|
||||
b.mods[index].remove();
|
||||
@@ -1484,7 +1517,7 @@ const b = {
|
||||
minDmgSpeed: 5,
|
||||
stillCount: 0,
|
||||
isArmed: false,
|
||||
endCycle: game.cycle + 2000 + 360 * Math.random(),
|
||||
endCycle: Infinity,
|
||||
lookFrequency: 41 + Math.floor(23 * Math.random()),
|
||||
range: 700,
|
||||
onDmg() {},
|
||||
@@ -1557,23 +1590,13 @@ const b = {
|
||||
Matter.Query.ray(map, this.position, mob[i].position).length === 0 &&
|
||||
Matter.Query.ray(body, this.position, mob[i].position).length === 0) {
|
||||
this.endCycle = 0 //end life if mob is near and visible
|
||||
isAmmoBack = false;
|
||||
if (Math.random() < 0.8) isAmmoBack = false; //20% chance to get ammo back from undetonated mines
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onEnd() {
|
||||
if (isAmmoBack) {
|
||||
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
|
||||
if (b.guns[i].name === "mine") {
|
||||
b.guns[i].ammo++
|
||||
game.updateGunHUD();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
if (this.isArmed) {
|
||||
const targets = [] //target nearby mobs
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
@@ -1605,6 +1628,15 @@ const b = {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isAmmoBack) {
|
||||
for (i = 0, len = b.guns.length; i < len; i++) { //find which gun
|
||||
if (b.guns[i].name === "mine") {
|
||||
b.guns[i].ammo++
|
||||
game.updateGunHUD();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
bullet[bIndex].torque += bullet[bIndex].inertia * 0.0002 * (0.5 - Math.random())
|
||||
@@ -2002,6 +2034,7 @@ const b = {
|
||||
recordedAmmo: 0,
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
const me = bullet.length;
|
||||
b.muzzleFlash(15);
|
||||
@@ -2024,6 +2057,7 @@ const b = {
|
||||
ammoPack: 8,
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: true,
|
||||
fire() {
|
||||
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 55 : 30) * b.modFireRate); // cool down
|
||||
if (b.isModShotgunImmune) mech.collisionImmuneCycle = mech.cycle + 30; //player is immune to collision damage for 30 cycles
|
||||
@@ -2055,12 +2089,13 @@ const b = {
|
||||
},
|
||||
{
|
||||
name: "super balls", //2
|
||||
description: "fire <strong>five</strong> balls in a wide arc<br>balls <strong>bounce</strong> with no momentum loss",
|
||||
description: "fire <strong>four</strong> balls in a wide arc<br>balls <strong>bounce</strong> with no momentum loss",
|
||||
ammo: 0,
|
||||
ammoPack: 8,
|
||||
ammoPack: 9,
|
||||
have: false,
|
||||
num: 5,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: true,
|
||||
fire() {
|
||||
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 25 : 20) * b.modFireRate); // cool down
|
||||
b.muzzleFlash(20);
|
||||
@@ -2093,10 +2128,11 @@ const b = {
|
||||
name: "fléchettes", //3
|
||||
description: "fire a volley of <strong>precise</strong> high velocity needles",
|
||||
ammo: 0,
|
||||
ammoPack: 24,
|
||||
defaultAmmoPack: 24,
|
||||
ammoPack: 22,
|
||||
defaultAmmoPack: 22,
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: false,
|
||||
count: 0, //used to track how many shots are in a volley before a big CD
|
||||
lastFireCycle: 0, //use to remember how longs its been since last fire, used to reset count
|
||||
fire() {
|
||||
@@ -2116,7 +2152,7 @@ const b = {
|
||||
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(angle));
|
||||
bullet[me].endCycle = game.cycle + 180;
|
||||
bullet[me].dmg = 1.15;
|
||||
bullet[me].dmg = 1.3;
|
||||
bullet[me].do = function () {
|
||||
if (this.speed < 10) this.force.y += this.mass * 0.0003; //no gravity until it slows don to improve aiming
|
||||
};
|
||||
@@ -2141,6 +2177,7 @@ const b = {
|
||||
ammoPack: 100,
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle
|
||||
@@ -2149,12 +2186,13 @@ const b = {
|
||||
bullet[me] = Bodies.polygon(mech.pos.x + 25 * Math.cos(dir), mech.pos.y + 25 * Math.sin(dir), 7, 5 * b.modBulletSize, {
|
||||
angle: dir,
|
||||
cycle: 0,
|
||||
endCycle: game.cycle + Math.floor(120 * b.isModBulletsLastLonger),
|
||||
endCycle: game.cycle + Math.floor((b.isModWaveReflect ? 480 : 120) * b.isModBulletsLastLonger),
|
||||
inertia: Infinity,
|
||||
frictionAir: 0,
|
||||
slow: 0,
|
||||
minDmgSpeed: 0,
|
||||
dmg: 0,
|
||||
isJustReflected: false,
|
||||
classType: "bullet",
|
||||
collisionFilter: {
|
||||
category: 0,
|
||||
@@ -2177,9 +2215,9 @@ const b = {
|
||||
for (let i = 0; i < q.length; i++) {
|
||||
slowCheck = 0.3;
|
||||
Matter.Body.setPosition(this, Vector.add(this.position, q[i].velocity)) //move with the medium
|
||||
let dmg = b.dmgScale * 0.1
|
||||
q[i].foundPlayer();
|
||||
let dmg = b.dmgScale * 0.5 / Math.sqrt(q[i].mass)
|
||||
q[i].damage(dmg);
|
||||
q[i].foundPlayer();
|
||||
game.drawList.push({ //add dmg to draw queue
|
||||
x: this.position.x,
|
||||
y: this.position.y,
|
||||
@@ -2198,6 +2236,40 @@ const b = {
|
||||
const wiggle = Vector.mult(transverse, wiggleMag * Math.cos(this.cycle * 0.35))
|
||||
Matter.Body.setPosition(this, Vector.add(this.position, wiggle))
|
||||
}
|
||||
// if (b.isModWaveReflect) { //single reflection
|
||||
// const sub = Vector.sub(this.position, mech.pos)
|
||||
// if (Vector.magnitude(sub) > 630) {
|
||||
// // Matter.Body.setPosition(this, Vector.add(this.position, Vector.mult(Vector.normalise(sub), -2 * POCKET_RANGE))) //teleport to opposite side
|
||||
// if (!this.isJustReflected) {
|
||||
// Matter.Body.setVelocity(this, Vector.mult(this.velocity, -1)); //reflect
|
||||
// this.isJustReflected = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (b.isModWaveReflect) {
|
||||
Matter.Body.setPosition(this, Vector.add(this.position, player.velocity)) //bullets move with player
|
||||
const sub = Vector.sub(this.position, mech.pos)
|
||||
if (Vector.magnitude(sub) > 630) {
|
||||
Matter.Body.setPosition(this, Vector.add(this.position, Vector.mult(Vector.normalise(sub), -2 * 630))) //teleport to opposite side
|
||||
}
|
||||
}
|
||||
|
||||
// if (b.isModWaveReflect) {
|
||||
// Matter.Body.setPosition(this, Vector.add(this.position, player.velocity)) //bullets move with player
|
||||
|
||||
// Matter.Body.setPosition(this, Vector.add(this.position, Vector.mult(Vector.normalise(sub), -2 * POCKET_RANGE))) //teleport to opposite side
|
||||
|
||||
// const sub = Vector.sub(this.position, mech.pos)
|
||||
// if (Vector.magnitude(sub) > 630) {
|
||||
// if (!this.isJustReflected) {
|
||||
// Matter.Body.setVelocity(this, Vector.mult(this.velocity, -1)); //reflect
|
||||
// this.isJustReflected = true;
|
||||
// }
|
||||
// } else {
|
||||
// this.isJustReflected = false
|
||||
// }
|
||||
// }
|
||||
}
|
||||
});
|
||||
World.add(engine.world, bullet[me]); //add bullet to world
|
||||
@@ -2216,6 +2288,7 @@ const b = {
|
||||
ammoPack: 4,
|
||||
have: false,
|
||||
isStarterGun: false,
|
||||
isEasyToAim: true,
|
||||
fireCycle: 0,
|
||||
ammoLoaded: 0,
|
||||
fire() {
|
||||
@@ -2238,6 +2311,7 @@ const b = {
|
||||
defaultAmmoPack: 6, //use to revert ammoPack after mod changes drop rate
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 25 : 10) * b.modFireRate); // cool down
|
||||
b.muzzleFlash(30);
|
||||
@@ -2282,6 +2356,7 @@ const b = {
|
||||
ammoPack: 7,
|
||||
have: false,
|
||||
isStarterGun: false,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle; // + Math.random() * 0.05;
|
||||
@@ -2312,6 +2387,7 @@ const b = {
|
||||
ammoPack: 2,
|
||||
have: false,
|
||||
isStarterGun: false,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle;
|
||||
@@ -2419,6 +2495,7 @@ const b = {
|
||||
ammoPack: (game.difficultyMode > 3) ? 2 : 3,
|
||||
have: false,
|
||||
isStarterGun: false,
|
||||
isEasyToAim: true,
|
||||
fire() {
|
||||
const speed = mech.crouch ? 36 : 22
|
||||
b.mine({
|
||||
@@ -2438,6 +2515,7 @@ const b = {
|
||||
ammoPack: (game.difficultyMode > 3) ? 3 : 4,
|
||||
have: false,
|
||||
isStarterGun: false,
|
||||
isEasyToAim: true,
|
||||
fire() {
|
||||
const me = bullet.length;
|
||||
const dir = mech.angle;
|
||||
@@ -2483,6 +2561,7 @@ const b = {
|
||||
ammoPack: 10,
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: true,
|
||||
fire() {
|
||||
b.drone(mech.crouch ? 45 : 1)
|
||||
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 25 : 5) * b.modFireRate); // cool down
|
||||
@@ -2495,6 +2574,7 @@ const b = {
|
||||
ammoPack: 35,
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
mech.fireCDcycle = mech.cycle + Math.floor((mech.crouch ? 12 : 5) * b.modFireRate); // cool down
|
||||
const me = bullet.length;
|
||||
@@ -2594,6 +2674,7 @@ const b = {
|
||||
ammoPack: 2.84,
|
||||
have: false,
|
||||
isStarterGun: false,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
const me = bullet.length;
|
||||
bullet[me] = Bodies.rectangle(0, 0, 0.015 * b.modBulletSize, 0.0015 * b.modBulletSize, {
|
||||
@@ -2836,6 +2917,7 @@ const b = {
|
||||
ammoPack: Infinity,
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
const reflectivity = 1 - 1 / (b.modLaserReflections * 1.5)
|
||||
let damage = b.dmgScale * b.modLaserDamage
|
||||
@@ -2994,6 +3076,7 @@ const b = {
|
||||
ammoPack: Infinity,
|
||||
have: false,
|
||||
isStarterGun: true,
|
||||
isEasyToAim: false,
|
||||
fire() {
|
||||
//calculate laser collision
|
||||
let best;
|
||||
|
||||
@@ -69,10 +69,11 @@ const game = {
|
||||
onTitlePage: true,
|
||||
paused: false,
|
||||
isChoosing: false,
|
||||
testing: false, //testing mode: shows wireframe and some variables
|
||||
testing: false, //testing mode: shows wire frame and some variables
|
||||
cycle: 0, //total cycles, 60 per second
|
||||
fpsCap: null, //limits frames per second to 144/2=72, on most monitors the fps is capped at 60fps by the hardware
|
||||
fpsCapDefault: 72, //use to change fpsCap back to normal after a hit from a mob
|
||||
isEasyToAimMode: true, //removes power ups that don't work well with a track pad
|
||||
cyclePaused: 0,
|
||||
fallHeight: 3000, //below this y position the player dies
|
||||
lastTimeStamp: 0, //tracks time stamps for measuring delta
|
||||
@@ -571,7 +572,6 @@ const game = {
|
||||
},
|
||||
clearNow: false,
|
||||
clearMap() {
|
||||
|
||||
if (b.isModMineAmmoBack) {
|
||||
let count = 0;
|
||||
for (i = 0, len = bullet.length; i < len; i++) { //count mines left on map
|
||||
|
||||
13
js/index.js
13
js/index.js
@@ -244,6 +244,9 @@ if (localSettings) {
|
||||
game.isBodyDamage = localSettings.isBodyDamage
|
||||
document.getElementById("body-damage").checked = localSettings.isBodyDamage
|
||||
|
||||
game.isEasyToAimMode = localSettings.isEasyToAimMode
|
||||
document.getElementById("track-pad-mode").checked = localSettings.isEasyToAimMode
|
||||
|
||||
game.difficultyMode = localSettings.difficultyMode
|
||||
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
||||
|
||||
@@ -256,11 +259,13 @@ if (localSettings) {
|
||||
} else {
|
||||
localSettings = {
|
||||
isBodyDamage: true,
|
||||
isEasyToAimMode: false,
|
||||
difficultyMode: '1',
|
||||
fpsCapDefault: '72',
|
||||
fpsCapDefault: 'max',
|
||||
};
|
||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||
document.getElementById("body-damage").checked = localSettings.isBodyDamage
|
||||
document.getElementById("track-pad-mode").checked = localSettings.isEasyToAimMode
|
||||
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
||||
document.getElementById("fps-select").value = localSettings.fpsCapDefault
|
||||
}
|
||||
@@ -358,6 +363,12 @@ document.getElementById("body-damage").addEventListener("input", () => {
|
||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||
});
|
||||
|
||||
document.getElementById("track-pad-mode").addEventListener("input", () => {
|
||||
game.isEasyToAimMode = document.getElementById("track-pad-mode").checked
|
||||
localSettings.isEasyToAimMode = game.isEasyToAimMode
|
||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||
});
|
||||
|
||||
// difficulty-select-custom event listener is set in build.makeGrid
|
||||
document.getElementById("difficulty-select").addEventListener("input", () => {
|
||||
game.difficultyMode = Number(document.getElementById("difficulty-select").value)
|
||||
|
||||
@@ -14,9 +14,10 @@ const level = {
|
||||
start() {
|
||||
if (level.levelsCleared === 0) {
|
||||
// level.difficultyIncrease(9)
|
||||
// b.giveGuns("missiles")
|
||||
// b.giveGuns("wave beam")
|
||||
// mech.setField("negative mass field")
|
||||
// b.giveMod("self-replication");
|
||||
// b.giveMod("wave phase velocity");
|
||||
// b.giveMod("reflective cavity");
|
||||
|
||||
level.intro(); //starting level
|
||||
// level.testingMap();
|
||||
@@ -676,7 +677,7 @@ const level = {
|
||||
level.fill.push({
|
||||
x: 1760,
|
||||
y: -1550,
|
||||
width: 1290,
|
||||
width: 1390,
|
||||
height: 550,
|
||||
color: "rgba(0,0,0,0.1)"
|
||||
});
|
||||
@@ -735,7 +736,7 @@ const level = {
|
||||
spawn.bodyRect(2710, -1250, 125, 125, 0.8);
|
||||
spawn.bodyRect(2705, -1350, 75, 100, 0.8);
|
||||
spawn.mapRect(3500, -1600, 350, 50);
|
||||
spawn.mapRect(1750, -1600, 1310, 50);
|
||||
spawn.mapRect(1750, -1600, 1410, 50);
|
||||
spawn.bodyRect(3100, -1015, 375, 15);
|
||||
spawn.bodyRect(3500, -850, 75, 125, 0.8);
|
||||
spawn.mapRect(3450, -1000, 50, 580); //left building wall
|
||||
|
||||
17
js/player.js
17
js/player.js
@@ -1119,6 +1119,7 @@ const mech = {
|
||||
fieldUpgrades: [{
|
||||
name: "field emitter",
|
||||
description: "use <strong class='color-f'>energy</strong> to <strong>shield</strong> yourself from <strong class='color-d'>damage</strong><br>lets you <strong>pick up</strong> and <strong>throw</strong> objects",
|
||||
isEasyToAim: false,
|
||||
effect: () => {
|
||||
mech.fieldShieldingScale = Number(b.modFieldEfficiency);
|
||||
game.replaceTextLog = true; //allow text over write
|
||||
@@ -1144,6 +1145,7 @@ const mech = {
|
||||
{
|
||||
name: "time dilation field",
|
||||
description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 1px;'>stop time</strong><br><em>can fire bullets while field is active</em>",
|
||||
isEasyToAim: true,
|
||||
effect: () => {
|
||||
mech.fieldFire = true;
|
||||
// mech.fieldRange = 130
|
||||
@@ -1210,6 +1212,7 @@ const mech = {
|
||||
{
|
||||
name: "plasma torch",
|
||||
description: "use <strong class='color-f'>energy</strong> to emit <strong class='color-d'>damaging</strong> plasma<br><em>effective at close range</em>",
|
||||
isEasyToAim: false,
|
||||
effect: () => {
|
||||
mech.hold = function () {
|
||||
if (mech.isHolding) {
|
||||
@@ -1226,7 +1229,7 @@ const mech = {
|
||||
|
||||
//calculate laser collision
|
||||
let best;
|
||||
let range = mech.fieldRange * 0.5 + (mech.crouch ? 500 : 300) * Math.sqrt(Math.random()) //+ 100 * Math.sin(mech.cycle * 0.3);
|
||||
let range = b.isModPlasmaRange * (175 + (mech.crouch ? 450 : 350) * Math.sqrt(Math.random())) //+ 100 * Math.sin(mech.cycle * 0.3);
|
||||
const dir = mech.angle // + 0.04 * (Math.random() - 0.5)
|
||||
const path = [{
|
||||
x: mech.pos.x + 20 * Math.cos(dir),
|
||||
@@ -1373,6 +1376,7 @@ const mech = {
|
||||
name: "negative mass field",
|
||||
description: "use <strong class='color-f'>energy</strong> to nullify <strong style='letter-spacing: 12px;'>gravity</strong><br><strong>launch</strong> larger blocks at much higher speeds",
|
||||
fieldDrawRadius: 0,
|
||||
isEasyToAim: true,
|
||||
effect: () => {
|
||||
mech.fieldFire = true;
|
||||
mech.throwChargeRate = 3;
|
||||
@@ -1389,6 +1393,7 @@ const mech = {
|
||||
if (mech.energy > DRAIN) {
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
mech.pushMobs360();
|
||||
//look for nearby objects to make zero-g
|
||||
function zeroG(who, range, mag = 1.06) {
|
||||
for (let i = 0, len = who.length; i < len; ++i) {
|
||||
@@ -1443,7 +1448,7 @@ const mech = {
|
||||
if (b.isModHawking) {
|
||||
for (let i = 0, len = mob.length; i < len; i++) {
|
||||
if (mob[i].distanceToPlayer2() < this.fieldDrawRadius * this.fieldDrawRadius && Matter.Query.ray(map, mech.pos, mob[i].position).length === 0 && Matter.Query.ray(body, mech.pos, mob[i].position).length === 0) {
|
||||
mob[i].damage(b.dmgScale * 0.09);
|
||||
mob[i].damage(b.dmgScale * 0.08);
|
||||
mob[i].locatePlayer();
|
||||
|
||||
//draw electricity
|
||||
@@ -1466,13 +1471,8 @@ const mech = {
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mech.pushMobs360();
|
||||
}
|
||||
ctx.globalCompositeOperation = "source-over";
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
//trigger cool down
|
||||
mech.fieldCDcycle = mech.cycle + 120;
|
||||
@@ -1491,6 +1491,7 @@ const mech = {
|
||||
{
|
||||
name: "standing wave harmonics",
|
||||
description: "three oscillating <strong>shields</strong> are permanently active<br><strong class='color-f'>energy</strong> regenerates while field is active",
|
||||
isEasyToAim: true,
|
||||
effect: () => {
|
||||
mech.hold = function () {
|
||||
if (mech.isHolding) {
|
||||
@@ -1530,6 +1531,7 @@ const mech = {
|
||||
{
|
||||
name: "nano-scale manufacturing",
|
||||
description: "excess <strong class='color-f'>energy</strong> used to build <strong>drones</strong><br><strong>2x</strong> <strong class='color-f'>energy</strong> regeneration",
|
||||
isEasyToAim: true,
|
||||
effect: () => {
|
||||
mech.fieldRegen *= 2;
|
||||
mech.hold = function () {
|
||||
@@ -1578,6 +1580,7 @@ const mech = {
|
||||
{
|
||||
name: "phase decoherence field",
|
||||
description: "become <strong>intangible</strong> and <strong>invisible</strong><br>drains <strong class='color-f'>energy</strong> as you move",
|
||||
isEasyToAim: true,
|
||||
effect: () => {
|
||||
// mech.fieldRange = 230
|
||||
mech.hold = function () {
|
||||
|
||||
@@ -102,7 +102,7 @@ const powerUps = {
|
||||
function pick(who, skip1 = -1, skip2 = -1, skip3 = -1) {
|
||||
let options = [];
|
||||
for (let i = 1; i < who.length; i++) {
|
||||
if (i !== mech.fieldMode && i !== skip1 && i !== skip2 && i !== skip3) options.push(i);
|
||||
if (i !== mech.fieldMode && (!game.isEasyToAimMode || mech.fieldUpgrades[i].isEasyToAim) && i !== skip1 && i !== skip2 && i !== skip3) options.push(i);
|
||||
}
|
||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
@@ -183,7 +183,7 @@ const powerUps = {
|
||||
function pick(who, skip1 = -1, skip2 = -1, skip3 = -1) {
|
||||
let options = [];
|
||||
for (let i = 0; i < who.length; i++) {
|
||||
if (!who[i].have && i !== skip1 && i !== skip2 && i !== skip3) options.push(i);
|
||||
if (!who[i].have && (!game.isEasyToAimMode || b.guns[i].isEasyToAim) && i !== skip1 && i !== skip2 && i !== skip3) options.push(i);
|
||||
}
|
||||
if (options.length > 0) return options[Math.floor(Math.random() * options.length)]
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ summary {
|
||||
}
|
||||
|
||||
.SVG-button:hover {
|
||||
background-color: #efeff5;
|
||||
background-color: #e8e8ee;
|
||||
}
|
||||
|
||||
#build-button {
|
||||
|
||||
16
todo.txt
16
todo.txt
@@ -1,8 +1,17 @@
|
||||
************** TODO - n-gon **************
|
||||
|
||||
mod - missiles release smaller missiles after 2s hits
|
||||
mod - get your next recursive mod 3 times
|
||||
are players aware of what a recursive mod is?
|
||||
too much of a nova drift rip off?
|
||||
|
||||
mod - grenades release smaller explosions
|
||||
mod - grenade needs a mod
|
||||
mod - time dilation field needs a mod
|
||||
mod - phase decoherence field needs a mod
|
||||
|
||||
buff mod field radius for standing wave harmonics
|
||||
|
||||
settings - auto aim at nearest mob
|
||||
settings - custom keys binding
|
||||
|
||||
mod - rocket propelled grenades
|
||||
grenades do +20% damage and move in an accelerating path
|
||||
@@ -51,6 +60,9 @@ lore - a robot (the player) gains self awareness
|
||||
atmosphere levels: change the pace, give the user a rest between combat
|
||||
low or no combat, but more graphics
|
||||
explore lore
|
||||
find power ups in "wrecked" mechs representing previous simulations
|
||||
how you could leave something in one simulation that effects a different simulation
|
||||
Maybe some strange quantum physics principle.
|
||||
add text for player thoughts?
|
||||
simple puzzles
|
||||
cool looking stuff
|
||||
|
||||
Reference in New Issue
Block a user