added starting level to builds, shooter boss nerf

This commit is contained in:
landgreen
2020-04-03 12:35:38 -07:00
parent 9cdfc6a3fd
commit 10bf7b599a
5 changed files with 75 additions and 87 deletions

View File

@@ -694,6 +694,8 @@ const b = {
}, },
remove() { remove() {
mech.maxHealth = 1; mech.maxHealth = 1;
b.modOnHealthChange();
mech.displayHealth();
} }
}, },
{ {

View File

@@ -29,29 +29,6 @@ function getUrlVars() {
}); });
return vars; return vars;
} }
// ?
// &gun0 = minigun & gun1 = shotgun & gun2 = super % 20 balls & gun3 = flechettes & gun4 = wave % 20 beam & gun5 = missiles & gun6 = flak & gun7 = grenades & gun8 = vacuum % 20 bomb &
// gun9 = mine & gun10 = spores & gun11 = drones & gun12 = ice % 20 IX & gun13 = foam & gun14 = rail % 20 gun & gun15 = laser & gun16 = pulse
// &
// mod0 = depleted % 20 uranium % 20 rounds & mod1 = kinetic % 20 bombardment & mod2 = fracture % 20 analysis & mod3 = fluoroantimonic % 20 acid &
// mod4 = negative % 20 feedback & mod5 = radiative % 20 equilibrium & mod6 = high % 20 explosives & mod7 = high % 20 explosives &
// mod8 = high % 20 explosives & mod9 = electric % 20 reactive % 20 armor & mod10 = thermal % 20 runaway & mod11 = auto - loading % 20 heuristics &
// mod12 = desublimated % 20 ammunition & mod13 = mass % 20 driver & mod14 = laser - bot & mod15 = nail - bot & mod16 = ablative % 20 drones &
// mod17 = ablative % 20 mines & mod18 = Lorentzian % 20 topology & mod19 = Lorentzian % 20 topology & mod20 = Lorentzian % 20 topology &
// mod21 = zoospore % 20 vector & mod22 = reaction % 20 inhibitor & mod23 = waste % 20 energy % 20 recovery & mod24 = scrap % 20 recycling &
// mod25 = acute % 20 stress % 20 response & mod26 = squirrel - cage % 20 rotor & mod27 = basidio - stomp & mod28 = Pauli % 20 exclusion &
// mod29 = annihilation & mod30 = quantum % 20 immortality & mod31 = weak % 20 anthropic % 20 principle & mod32 = entanglement & mod33 = piezoelectricity &
// mod34 = ground % 20 state & mod35 = energy % 20 conservation & mod36 = entropy % 20 exchange & mod37 = overcharge & mod38 = supersaturation &
// mod39 = recursive % 20 healing & mod40 = mass - energy % 20 equivalence & mod41 = Bayesian % 20 inference & mod42 = % 2 B1 % 20 cardinality &
// mod43 = catabolism & mod44 = leveraged % 20 investment & mod45 = ice % 20 crystal % 20n ucleation & mod46 = shotgun % 20 spin - statistics &
// mod47 = super % 20 duper & mod48 = super % 20 duper & mod49 = flechettes % 20 cartridges & mod50 = irradiated % 20n eedles & mod51 = wave % 20 phase % 20 velocity &
// mod52 = pocket % 20 universe & mod53 = self - replication & mod54 = optimized % 20 shell % 20 packing & mod55 = electromagnetic % 20 pulse &
// mod56 = mine % 20 reclamation & mod57 = tinsellated % 20 flagella & mod58 = redundant % 20 systems & mod59 = heavy % 20 water & mod60 = foam % 20 stabilization &
// mod61 = fragmenting % 20 projectiles & mod62 = specular % 20 reflection & mod63 = specular % 20 reflection & mod64 = specular % 20 reflection &
// mod65 = quantum % 20 dissipation & field = phase % 20 decoherence % 20 field & difficulty = 2
window.addEventListener('load', (event) => { window.addEventListener('load', (event) => {
const set = getUrlVars() const set = getUrlVars()
if (Object.keys(set).length !== 0) { if (Object.keys(set).length !== 0) {
@@ -76,7 +53,21 @@ const build = {
game.difficultyMode = Number(set[property]) game.difficultyMode = Number(set[property])
document.getElementById("difficulty-select").value = Number(set[property]) document.getElementById("difficulty-select").value = Number(set[property])
} }
if (property === "level") {
level.levelsCleared += Number(set[property]);
level.difficultyIncrease(Number(set[property]) * game.difficultyMode) //increase difficulty based on modes
spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns
level.onLevel++
}
} }
for (let i = 0; i < bullet.length; ++i) Matter.World.remove(engine.world, bullet[i]);
bullet = []; //remove any bullets that might have spawned from mods
if (b.inventory.length > 0) {
b.activeGun = b.inventory[0] //set first gun to active gun
game.makeGunHUD();
}
b.modOnHealthChange();
} }
}, },
pauseGrid() { pauseGrid() {
@@ -331,6 +322,7 @@ const build = {
} }
url += `&field=${encodeURIComponent(mech.fieldUpgrades[mech.fieldMode].name.trim())}` url += `&field=${encodeURIComponent(mech.fieldUpgrades[mech.fieldMode].name.trim())}`
url += `&difficulty=${game.difficultyMode}` url += `&difficulty=${game.difficultyMode}`
url += `&level=${Number(document.getElementById("starting-level").value)}`
console.log(url) console.log(url)
return url return url
}, },
@@ -348,10 +340,9 @@ const build = {
//remove any bullets that might have spawned from mods //remove any bullets that might have spawned from mods
for (let i = 0; i < bullet.length; ++i) Matter.World.remove(engine.world, bullet[i]); for (let i = 0; i < bullet.length; ++i) Matter.World.remove(engine.world, bullet[i]);
bullet = []; bullet = [];
const levelsCleared = Number(document.getElementById("starting-level").value) - 1
const increase = Math.min(99, Number(document.getElementById("starting-level").value) * game.difficultyMode) level.difficultyIncrease(Math.min(99, levelsCleared * game.difficultyMode)) //increase difficulty based on modes
level.levelsCleared += increase; level.levelsCleared += levelsCleared;
level.difficultyIncrease(increase) //increase difficulty based on modes
document.body.style.cursor = "none"; document.body.style.cursor = "none";
document.body.style.overflow = "hidden" document.body.style.overflow = "hidden"

View File

@@ -12,8 +12,8 @@ const level = {
onLevel: 0, onLevel: 0,
levelsCleared: 0, levelsCleared: 0,
start() { start() {
if (build.isURLBuild && level.levelsCleared === 0) build.onLoadPowerUps();
if (level.levelsCleared === 0) { if (level.levelsCleared === 0) {
if (build.isURLBuild) build.onLoadPowerUps();
// level.difficultyIncrease(9) // level.difficultyIncrease(9)
// b.giveGuns("vacuum bomb") // b.giveGuns("vacuum bomb")
// mech.setField("phase decoherence field") // mech.setField("phase decoherence field")
@@ -32,13 +32,13 @@ const level = {
// level.warehouse(); // level.warehouse();
// level.highrise(); // level.highrise();
// level.office(); // level.office();
level.levelAnnounce();
} 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
// spawn.pickList = ["focuser", "focuser"] // spawn.pickList = ["focuser", "focuser"]
level[level.levels[level.onLevel]](); //picks the current map from the the levels array level[level.levels[level.onLevel]](); //picks the current map from the the levels array
level.levelAnnounce();
} }
level.levelAnnounce();
game.noCameraScroll(); game.noCameraScroll();
game.setZoom(); game.setZoom();
level.addToWorld(); //add bodies to game engine level.addToWorld(); //add bodies to game engine
@@ -98,7 +98,8 @@ const level = {
//****************************************************************************************************************** //******************************************************************************************************************
testing() { testing() {
// level.difficultyIncrease(9) //level 7 on normal, level 4 on hard, level 1.2 on why? level.difficultyIncrease(9);
spawn.setSpawnList();
spawn.setSpawnList(); spawn.setSpawnList();
level.defaultZoom = 1500 level.defaultZoom = 1500
game.zoomTransition(level.defaultZoom) game.zoomTransition(level.defaultZoom)
@@ -144,8 +145,11 @@ const level = {
spawn.mapRect(6400, -200, 400, 300); //right wall spawn.mapRect(6400, -200, 400, 300); //right wall
spawn.mapRect(6700, -1800, 800, 2600); //right wall spawn.mapRect(6700, -1800, 800, 2600); //right wall
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
// spawn.laserBoss(2900, -500)
// spawn.exploder(3200, -500)
spawn.timeSkipBoss(2900, -500) spawn.timeSkipBoss(2900, -500)
spawn.randomMob(3200, -500) // spawn.randomMob(3200, -500)
}, },
bosses() { bosses() {

View File

@@ -644,7 +644,6 @@ const spawn = {
me.eventHorizon = 1300; //required for black hole me.eventHorizon = 1300; //required for black hole
me.seeAtDistance2 = (me.eventHorizon + 1000) * (me.eventHorizon + 1000); //vision limit is event horizon me.seeAtDistance2 = (me.eventHorizon + 1000) * (me.eventHorizon + 1000); //vision limit is event horizon
me.accelMag = 0.00013 * game.accelScale; me.accelMag = 0.00013 * game.accelScale;
// me.collisionFilter.mask = cat.player | cat.bullet
// me.frictionAir = 0.005; // me.frictionAir = 0.005;
// me.memory = 1600; // me.memory = 1600;
Matter.Body.setDensity(me, 0.018); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.018); //extra dense //normal is 0.001 //makes effective life much larger
@@ -667,6 +666,8 @@ const spawn = {
this.stroke = "#000" this.stroke = "#000"
this.isShielded = false; this.isShielded = false;
this.dropPowerUp = true; this.dropPowerUp = true;
this.collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob; //can't touch bullets
ctx.beginPath(); ctx.beginPath();
ctx.arc(this.position.x, this.position.y, this.eventHorizon, 0, 2 * Math.PI); ctx.arc(this.position.x, this.position.y, this.eventHorizon, 0, 2 * Math.PI);
ctx.fillStyle = `rgba(255,255,255,${mech.energy*0.5})`; ctx.fillStyle = `rgba(255,255,255,${mech.energy*0.5})`;
@@ -696,6 +697,7 @@ const spawn = {
this.seePlayer.recall = false this.seePlayer.recall = false
this.fill = "transparent" this.fill = "transparent"
this.stroke = "transparent" this.stroke = "transparent"
this.collisionFilter.mask = cat.player | cat.map | cat.body | cat.mob; //can't touch bullets
ctx.beginPath(); ctx.beginPath();
ctx.arc(this.position.x, this.position.y, this.eventHorizon, 0, 2 * Math.PI); ctx.arc(this.position.x, this.position.y, this.eventHorizon, 0, 2 * Math.PI);
ctx.fillStyle = `rgba(0,0,0,${0.1*Math.random()})`; ctx.fillStyle = `rgba(0,0,0,${0.1*Math.random()})`;
@@ -904,32 +906,16 @@ const spawn = {
vertexCollision(where, look, map); vertexCollision(where, look, map);
vertexCollision(where, look, body); vertexCollision(where, look, body);
if (!mech.isStealth) vertexCollision(where, look, [player]); if (!mech.isStealth) vertexCollision(where, look, [player]);
//hitting mob if (best.who && best.who === player && mech.collisionImmuneCycle < mech.cycle) {
if (best.who) { mech.collisionImmuneCycle = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles
// if (best.who.mob) { mech.damage(this.dmg);
// best.who.damage(Infinity); game.drawList.push({ //add dmg to draw queue
// //draw damage x: best.x,
// game.drawList.push({ //add dmg to draw queue y: best.y,
// x: best.x, radius: this.dmg * 1500,
// y: best.y, color: "rgba(80,0,255,0.5)",
// radius: 50, time: 20
// color: game.playerDmgColor, });
// time: game.drawTime
// });
// }
// hitting player
if (best.who === player && mech.collisionImmuneCycle < mech.cycle) {
mech.collisionImmuneCycle = mech.cycle + b.modCollisionImmuneCycles; //player is immune to collision damage for 30 cycles
mech.damage(this.dmg);
//draw damage
game.drawList.push({ //add dmg to draw queue
x: best.x,
y: best.y,
radius: this.dmg * 1500,
color: "rgba(80,0,255,0.5)",
time: 20
});
}
} }
//draw beam //draw beam
if (best.dist2 === Infinity) best = look; if (best.dist2 === Infinity) best = look;
@@ -1077,30 +1063,35 @@ const spawn = {
// me.isStatic = true; // me.isStatic = true;
// me.memory = 360; // me.memory = 360;
// me.seePlayerFreq = Math.round((40 + 30 * Math.random()) * game.lookFreqScale); // me.seePlayerFreq = Math.round((40 + 30 * Math.random()) * game.lookFreqScale);
// me.isBig = false; // // me.isBig = false;
// me.scaleMag = Math.max(5 - me.mass, 1.75); // // me.scaleMag = Math.max(5 - me.mass, 1.75);
// me.onDeath = function () { // me.onDeath = function () {
// if (this.isBig) { // // if (this.isBig) {
// Matter.Body.scale(this, 1 / this.scaleMag, 1 / this.scaleMag); // // Matter.Body.scale(this, 1 / this.scaleMag, 1 / this.scaleMag);
// this.isBig = false; // // this.isBig = false;
// } // // }
// };
// me.onHit = function () {
// game.timeSkip(120)
// }; // };
// me.do = function () { // me.do = function () {
// this.seePlayerCheck(); // this.seePlayerCheck();
// this.blink(); // this.blink();
// //strike by expanding // //strike by expanding
// if (this.isBig) { // // if (this.isBig) {
// if (this.cd - this.delay + 15 < game.cycle) { // // if (this.cd - this.delay + 15 < game.cycle) {
// Matter.Body.scale(this, 1 / this.scaleMag, 1 / this.scaleMag); // // Matter.Body.scale(this, 1 / this.scaleMag, 1 / this.scaleMag);
// this.isBig = false; // // this.isBig = false;
// } // // }
// } else if (this.seePlayer.yes && this.cd < game.cycle) { // // } else
// if (this.seePlayer.yes && this.cd < game.cycle) {
// const dist = Vector.sub(this.seePlayer.position, this.position); // const dist = Vector.sub(this.seePlayer.position, this.position);
// const distMag2 = Vector.magnitudeSquared(dist); // const distMag2 = Vector.magnitudeSquared(dist);
// if (distMag2 < 80000) { // if (distMag2 < 80000) {
// this.cd = game.cycle + this.delay; // this.cd = game.cycle + this.delay;
// Matter.Body.scale(this, this.scaleMag, this.scaleMag);
// this.isBig = true; // // Matter.Body.scale(this, this.scaleMag, this.scaleMag);
// // this.isBig = true;
// } // }
// } // }
// }; // };
@@ -1169,7 +1160,7 @@ const spawn = {
x: x, x: x,
y: y y: y
}; };
me.fireFreq = 0.025; me.fireFreq = 0.02;
me.noseLength = 0; me.noseLength = 0;
me.fireAngle = 0; me.fireAngle = 0;
me.accelMag = 0.005 * game.accelScale; me.accelMag = 0.005 * game.accelScale;
@@ -1179,7 +1170,7 @@ const spawn = {
x: 0, x: 0,
y: 0 y: 0
}; };
Matter.Body.setDensity(me, 0.023 + 0.001 * Math.sqrt(game.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger Matter.Body.setDensity(me, 0.02 + 0.0008 * Math.sqrt(game.difficulty)); //extra dense //normal is 0.001 //makes effective life much larger
me.onDeath = function () { me.onDeath = function () {
powerUps.spawnBossPowerUp(this.position.x, this.position.y) powerUps.spawnBossPowerUp(this.position.x, this.position.y)
}; };

View File

@@ -1,8 +1,18 @@
mod - electromagnetic pulse - vacuum bomb removes shields and does 20% extra damage
************** TODO - n-gon ************** ************** TODO - n-gon **************
lore - a robot (the player) gains self awareness
each mod/gun/field is a new tech
all the technology leads to the singularity
each game run is actually the mech simulating a possible escape
this is why the graphics are so bad, its just a simulation
final mod is "this is just a simulation"
you get immortality and Infinity damage
the next level is the final level
when you die with Quantum Immortality there is a chance of lore text
make a global variable that goes up by one every time you play
show text at start, loading simulation #...
mod - spores with no target hang out about player mod - spores with no target hang out about player
mod - status effects last 1 second longer mod - status effects last 1 second longer
@@ -58,16 +68,6 @@ settings - custom keys binding
mod - energy recharges faster when not moving mod - energy recharges faster when not moving
lore - a robot (the player) gains self awareness
each mod/gun/field is a new tech
all the technology leads to the singularity
each game run is actually the mech simulating a possible escape
this is why the graphics are so bad, its just a simulation
final mod is "this is just a simulation"
you get immortality and Infinity damage
the next level is the final level
when you die with Quantum Immortality there is a chance of lore text
atmosphere levels: change the pace, give the user a rest between combat atmosphere levels: change the pace, give the user a rest between combat
low or no combat, but more graphics low or no combat, but more graphics
explore lore explore lore