This commit is contained in:
landgreen
2020-03-16 08:17:34 -07:00
parent f6238ff882
commit 5768664d27
5 changed files with 58 additions and 61 deletions

View File

@@ -1,3 +1,3 @@
2-d physics platformer shooter
2-d physics rogue-lite platformer shooter
https://landgreen.github.io/sidescroller/

View File

@@ -1067,8 +1067,8 @@ const b = {
}
},
{
name: "daze",
description: "blocking <strong>stuns</strong> mobs for 1 second<br>with the <strong>perfect diamagnetism</strong> field",
name: "flux pinning",
description: "blocking <strong>stuns</strong> mobs for <strong>+1</strong> second<br>with the <strong>perfect diamagnetism</strong> field",
maxCount: 9,
count: 0,
allowed() {
@@ -1082,6 +1082,22 @@ const b = {
b.isModStunField = 0;
}
},
{
name: "bremsstrahlung radiation",
description: "<strong>blocking</strong> with your field does <strong class='color-d'>damage</strong>",
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<br>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 <strong>plasma torch's</strong> range by <strong>33%</strong>",
@@ -1114,22 +1130,6 @@ const b = {
b.isModHawking = 0;
}
},
{
name: "bremsstrahlung radiation",
description: "<strong>blocking</strong> with your field does <strong class='color-d'>damage</strong>",
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<br>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: "<strong>standing wave harmonics</strong> shield is retuned<br>increase <strong>size</strong> and <strong>blocking</strong> efficiency by <strong>30%</strong>",

View File

@@ -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");

View File

@@ -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();
}
}
}
},

View File

@@ -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