diff --git a/README.md b/README.md index ca9e4077..1e6ada82 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -2-d physics platformer shooter +2-d physics rogue-lite platformer shooter https://landgreen.github.io/sidescroller/ diff --git a/js/bullets.js b/js/bullets.js index fead1b2d..506c06a7 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -1067,8 +1067,8 @@ const b = { } }, { - name: "daze", - description: "blocking stuns mobs for 1 second
with the perfect diamagnetism field", + name: "flux pinning", + description: "blocking stuns mobs for +1 second
with the perfect diamagnetism field", maxCount: 9, count: 0, allowed() { @@ -1082,6 +1082,22 @@ const b = { b.isModStunField = 0; } }, + { + name: "bremsstrahlung radiation", + description: "blocking with your field does damage", + maxCount: 9, + count: 0, + allowed() { + return mech.fieldUpgrades[mech.fieldMode].name === "standing wave harmonics" || mech.fieldUpgrades[mech.fieldMode].name === "perfect diamagnetism" + }, + requires: "standing wave harmonics
or perfect diamagnetism", + effect() { + b.modBlockDmg += 0.4 //if you change this value also update the for loop in the electricity graphics in mech.pushMass + }, + remove() { + b.modBlockDmg = 0; + } + }, { name: "plasma jet", description: "increase plasma torch's range by 33%", @@ -1114,22 +1130,6 @@ const b = { b.isModHawking = 0; } }, - { - name: "bremsstrahlung radiation", - description: "blocking with your field does damage", - maxCount: 9, - count: 0, - allowed() { - return mech.fieldUpgrades[mech.fieldMode].name === "standing wave harmonics" || mech.fieldUpgrades[mech.fieldMode].name === "perfect diamagnetism" - }, - requires: "standing wave harmonics
or perfect diamagnetism", - effect() { - b.modBlockDmg += 0.4 //if you change this value also update the for loop in the electricity graphics in mech.pushMass - }, - remove() { - b.modBlockDmg = 0; - } - }, { name: "frequency resonance", description: "standing wave harmonics shield is retuned
increase size and blocking efficiency by 30%", diff --git a/js/level.js b/js/level.js index 1fff56c9..11316007 100644 --- a/js/level.js +++ b/js/level.js @@ -15,7 +15,7 @@ const level = { if (level.levelsCleared === 0) { // level.difficultyIncrease(9) // b.giveGuns("mine") - // mech.setField("perfect diamagnetism") + // mech.setField("phase decoherence field") // b.giveMod("irradiated needles"); // b.giveMod("reflective cavity"); diff --git a/js/player.js b/js/player.js index 33870216..00780e00 100644 --- a/js/player.js +++ b/js/player.js @@ -696,10 +696,10 @@ const mech = { mech.wakeCheck(); }, fieldMeterColor: "#0cf", - drawFieldMeter(range = 60) { + drawFieldMeter(bgColor = "rgba(0, 0, 0, 0.4)", range = 60) { if (mech.energy < mech.fieldEnergyMax) { mech.energy += mech.fieldRegen; - ctx.fillStyle = "rgba(0, 0, 0, 0.4)"; + ctx.fillStyle = bgColor; const xOff = mech.pos.x - mech.radius * mech.fieldEnergyMax const yOff = mech.pos.y - 50 ctx.fillRect(xOff, yOff, range * mech.fieldEnergyMax, 10); @@ -1171,7 +1171,7 @@ const mech = { isEasyToAim: false, effect: () => { mech.fieldShieldingScale = 0; - mech.fieldMeterColor = "#0af" + // mech.fieldMeterColor = "#0af" // mech.fieldArc = 0.3; //run calculateFieldThreshold after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob) // mech.calculateFieldThreshold(); mech.hold = function () { @@ -1186,19 +1186,12 @@ const mech = { } else if ((keys[32] || game.mouseDownRight && mech.energy > 0.05 && mech.fieldCDcycle < mech.cycle)) { //not hold but field button is pressed //draw field if (mech.holdingTarget) { - ctx.fillStyle = "rgba(120,190,255," + (0.06 + 0.03 * Math.random()) + ")"; - ctx.strokeStyle = "rgba(120, 190, 255, " + (0.35 + 0.05 * Math.random()) + ")" + ctx.fillStyle = "rgba(110,170,200," + (0.06 + 0.03 * Math.random()) + ")"; + ctx.strokeStyle = "rgba(110, 200, 235, " + (0.35 + 0.05 * Math.random()) + ")" } else { - ctx.fillStyle = "rgba(120,190,255," + (0.3 + 0.13 * Math.random() - 0.15 * wave) + ")"; - ctx.strokeStyle = "rgba(120, 190, 255, " + (0.3 + 0.5 * Math.random()) + ")" + ctx.fillStyle = "rgba(110,170,200," + (0.2 + 0.13 * Math.random() - 0.15 * wave) + ")"; + ctx.strokeStyle = "rgba(110, 200, 235, " + (0.4 + 0.5 * Math.random()) + ")" } - // if (mech.holdingTarget) { - // ctx.fillStyle = "rgba(110,175,200," + (0.06 + 0.03 * Math.random()) + ")"; - // ctx.strokeStyle = "rgba(115, 220, 255, " + (0.35 + 0.05 * Math.random()) + ")" - // } else { - // ctx.fillStyle = "rgba(110,175,200," + (0.20 + 0.07 * Math.random() - 0.1 * wave) + ")"; - // ctx.strokeStyle = "rgba(115, 220, 255, " + (0.3 + 0.5 * Math.random()) + ")" - // } ctx.beginPath(); ctx.arc(mech.pos.x, mech.pos.y, mech.fieldRange, mech.angle - Math.PI * mech.fieldArc, mech.angle + Math.PI * mech.fieldArc, false); ctx.lineWidth = 2.5 - 1.5 * wave; @@ -1458,7 +1451,7 @@ const mech = { } else { mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists) } - mech.drawFieldMeter() + mech.drawFieldMeter("rgba(0, 0, 0, 0.2)") } } }, @@ -1470,10 +1463,9 @@ const mech = { effect: () => { mech.fieldFire = true; mech.holdingMassScale = 0.03; //can hold heavier blocks with lower cost to jumping - // mech.fieldMeterColor = "#000" + mech.fieldMeterColor = "#000" mech.hold = function () { - mech.drawFieldMeter() mech.fieldDamageResistance = 1; if (mech.isHolding) { mech.drawHold(mech.holdingTarget); @@ -1589,6 +1581,7 @@ const mech = { mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists) this.fieldDrawRadius = 0 } + mech.drawFieldMeter("rgba(0,0,0,0.2)") } } }, @@ -1758,7 +1751,26 @@ const mech = { } else { mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists) } - mech.drawFieldMeter() + // mech.drawFieldMeter() + if (mech.energy < mech.fieldEnergyMax) { + mech.energy += mech.fieldRegen; + const xOff = mech.pos.x - mech.radius * mech.fieldEnergyMax + const yOff = mech.pos.y - 50 + + ctx.fillStyle = "rgba(0, 0, 0, 0.3)"; + ctx.fillRect(xOff, yOff, 60 * mech.fieldEnergyMax, 10); + + ctx.fillStyle = mech.fieldMeterColor; + ctx.fillRect(xOff, yOff, 60 * mech.energy, 10); + + ctx.beginPath() + ctx.rect(xOff, yOff, 60 * mech.fieldEnergyMax, 10); + // ctx.fill(); + ctx.strokeStyle = "rgb(0, 0, 0)"; + ctx.lineWidth = 1; + ctx.stroke(); + } + } } }, diff --git a/todo.txt b/todo.txt index 54a112d2..0b589dac 100644 --- a/todo.txt +++ b/todo.txt @@ -1,18 +1,14 @@ -perfect diamagnetism balance and graphics -unique energy colors for fields -game info on pause screen -falling off the map, on easy and normal difficulty - sets the player to the entrance - sets power ups to the exit - - ************** TODO - n-gon ************** -perfect diamagnetism should get larger as it blocks more, and then slowly fad back to the normal size +work on burn status effect + graphics don't look right + how is it different from the chemical dot -gun or mod - drones that only last for 2 seconds +perfect diamagnetism should get larger as it blocks more, and then slowly fade back to the normal size + +gun - bullets that acts like drones but only last for 2 seconds and do more damage field - the basic field emitter, but no energy loss and no knock back on blocks this field should make blocking a viable strategy @@ -45,29 +41,18 @@ bug - getting stuck in crouch mode I don't think I was holding a block might have been standing on a block... not sure -mobs - add in a function to the main loops that does injected code for each mob - each mob would get an object with a game.cycle for ending and a method to run each cycle until the end is met - this could be a DoT, graphics, slow, blind - stun - combine blind, slow - with increased gravity effects, but how - burn effect doesn't look right, too similar to poison - burn status could spread to player - mod - grenade explosions stun enemies - mod - vacuum bomb does DoT damage after exploding - mod - super balls become fire balls? - mod - laser mod has a chance to set things on fire - settings - auto aim at nearest mob settings - custom keys binding gun - buff vacuum bomb - its weak late game + it's weak late game can't spam it faster bad vs. shields doesn't scale up to huge groups buff collision damage? mod - double explosions? mod - doesn't suck player in? + mod - DoT damage after exploding mod - make bodies destroyable they drop ammo and heals