diff --git a/index.html b/index.html index ba1ded8..d905435 100644 --- a/index.html +++ b/index.html @@ -79,6 +79,12 @@ ******************************************************************************* -->
+
+
+
+
+
+
Select 5 power ups and see how far you can progress. diff --git a/js/bullets.js b/js/bullets.js index 4ab5d2c..4059719 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -72,13 +72,13 @@ const b = { b.mods[i].count = 0 } }, - acidModSetCheck() { - if (mech.health > 0.9) { + modOnHealthChange() { + if (b.isModAcidDmg && mech.health > 0.9) { game.playerDmgColor = "rgba(0,80,80,0.9)" - b.isModAcidDmg = true; + b.modAcidDmg = 1.4 } else { game.playerDmgColor = "rgba(0,0,0,0.7)" - b.isModAcidDmg = false; + b.modAcidDmg = 0 } }, mods: [{ @@ -96,8 +96,8 @@ const b = { maxCount: 1, count: 0, effect() { - b.modAcidDmg = 0.9 - b.acidModSetCheck(); + b.isModAcidDmg = true; + b.modOnHealthChange(); } }, { @@ -320,7 +320,7 @@ const b = { maxCount: 1, count: 0, effect: () => { - b.isModMassEnergy = true // used in mech.usePowerUp + b.isModMassEnergy = true // used in mech.grabPowerUp mech.fieldMeter = mech.fieldEnergyMax } }, diff --git a/js/engine.js b/js/engine.js index 8e9bf0b..1b6f010 100644 --- a/js/engine.js +++ b/js/engine.js @@ -175,7 +175,7 @@ function collisionChecks(event) { //mob + bullet collisions if (obj.classType === "bullet" && obj.speed > obj.minDmgSpeed) { // const dmg = b.dmgScale * (obj.dmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))); - let dmg = b.dmgScale * (obj.dmg + b.modAcidDmg * b.isModAcidDmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))) + let dmg = b.dmgScale * (obj.dmg + b.modAcidDmg + 0.15 * obj.mass * Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity))) if (b.isModCrit && !mob[k].seePlayer.recall && !mob[k].shield) dmg *= 5 mob[k].foundPlayer(); mob[k].damage(dmg); @@ -193,7 +193,7 @@ function collisionChecks(event) { if (obj.classType === "body" && obj.speed > 5) { const v = Vector.magnitude(Vector.sub(mob[k].velocity, obj.velocity)); if (v > 8) { - let dmg = b.dmgScale * (b.modAcidDmg * b.isModAcidDmg + v * Math.sqrt(obj.mass) * 0.07); + let dmg = b.dmgScale * (b.modAcidDmg + v * Math.sqrt(obj.mass) * 0.07); mob[k].damage(dmg); if (mob[k].distanceToPlayer2() < 1000000) mob[k].foundPlayer(); game.drawList.push({ diff --git a/js/game.js b/js/game.js index 4e58eda..0e9c923 100644 --- a/js/game.js +++ b/js/game.js @@ -45,13 +45,13 @@ const game = { game.draw.cons(); game.draw.body(); mobs.loop(); + mobs.healthBar(); mech.draw(); mech.hold(); level.drawFills(); game.draw.drawMapPath(); b.fire(); b.bulletActions(); - mobs.healthBar(); game.drawCircle(); ctx.restore(); game.drawCursor(); @@ -272,19 +272,19 @@ const game = { if (keys[80] && !game.isChoosing) { //p for pause if (game.paused) { + build.unPauseGrid() game.paused = false; + level.levelAnnounce(); + document.body.style.cursor = "none"; requestAnimationFrame(cycle); } else { game.paused = true; game.replaceTextLog = true; - game.makeTextLog("

PAUSED

", 1); - // let text = "

PAUSED


" - // //output current mod, field, and gun info when paused - // if (mech.fieldMode !== 0) text += "

" + mech.fieldUpgrades[mech.fieldMode].name + "
" + mech.fieldUpgrades[mech.fieldMode].description + "

" - // if (b.mod !== null) text += "

" + b.mods[b.mod].name + "
" + b.mods[b.mod].description + "

" - // if (b.activeGun !== null) text += "

" + b.guns[b.activeGun].name + "
" + b.guns[b.activeGun].description + "

" - // text += "
" - // game.makeTextLog(text, 1); + // game.makeTextLog("

PAUSED

", 1); + //display grid + // document.title = "PAUSED: press P to resume"; + build.pauseGrid() + document.body.style.cursor = "auto"; } } @@ -486,6 +486,9 @@ const game = { document.getElementById("choose-grid").style.display = "none" document.getElementById("info").style.display = "inline"; document.getElementById("build-button").style.display = "inline" + document.getElementById("build-grid").style.display = "none" + document.getElementById("pause-grid-left").style.display = "none" + document.getElementById("pause-grid-right").style.display = "none" isShowingBuilds = false document.getElementById("splash").style.display = "inline"; document.getElementById("dmg").style.display = "none"; diff --git a/js/index.js b/js/index.js index f2ed4b2..de2bb33 100644 --- a/js/index.js +++ b/js/index.js @@ -2,6 +2,9 @@ /* TODO: ******************************************* ***************************************************** +missiles don't explode reliably enough + they can bounce, which is cool, but they should still explode right after a bounce + mod: do something when at full health extra damage (seems too simple) power up drop rate? (hard to see directly) @@ -191,9 +194,9 @@ const build = { makeGrid() { let text = `
- + - start + start @@ -202,7 +205,7 @@ const build = {
-
+