scroll menus

shotgun balance
  ice-shot: less spread, higher damage, more crystals
  needle-shot: more needles, higher damage, less spread
  foam-shot: 1 more bubble

power up selection and pause menu elements scroll individually now
  it looks great on my computer, but different operating systems and browsers are unpredictable
  let me know if text is hidden or if it doesn't scroll for you and what OS and browser you're on
This commit is contained in:
landgreen
2021-07-26 06:15:06 -07:00
parent 271791703f
commit 3977b44ec7
10 changed files with 57 additions and 62 deletions

View File

@@ -2057,7 +2057,7 @@ const b = {
friction: 0,
frictionAir: 0.023,
restitution: 0.9,
dmg: 0.5, //damage done in addition to the damage from momentum
dmg: 0.55, //damage done in addition to the damage from momentum
lookFrequency: 14 + Math.floor(8 * Math.random()),
endCycle: simulation.cycle + 150 * tech.isBulletsLastLonger + Math.floor(25 * Math.random()),
classType: "bullet",
@@ -2781,7 +2781,7 @@ const b = {
if (tech.isNailRadiation) {
mobs.statusDoT(who, tech.isFastRadiation ? 12 : 3, tech.isSlowRadiation ? 240 : (tech.isFastRadiation ? 30 : 120)) // one tick every 30 cycles
} else {
let dmg = b.dmgScale * 5.5
let dmg = b.dmgScale * 6
if (tech.isCrit && who.isStunned) dmg *= 4
who.damage(dmg, tech.isNeedleShieldPierce);
simulation.drawList.push({ //add dmg to draw queue
@@ -3775,8 +3775,8 @@ const b = {
name: "shotgun",
description: "fire a wide <strong>burst</strong> of short range <strong> bullets</strong>",
ammo: 0,
ammoPack: 5,
defaultAmmoPack: 5,
ammoPack: 4.5,
defaultAmmoPack: 4.5,
have: false,
do() {},
fire() {
@@ -3933,10 +3933,10 @@ const b = {
});
}
} else if (tech.isIceShot) {
const spread = (m.crouch ? 0.6 : 1.6)
for (let i = 0, len = 16 * (tech.isShotgunReversed ? 1.6 : 1); i < len; i++) {
const spread = (m.crouch ? 0.7 : 1.2)
for (let i = 0, len = 18 * (tech.isShotgunReversed ? 1.6 : 1); i < len; i++) {
// iceIX(speed = 0, dir = m.angle + Math.PI * 2 * Math.random(), where = { x: m.pos.x + 30 * Math.cos(m.angle), y: m.pos.y + 30 * Math.sin(m.angle) }) {
b.iceIX(14 + 30 * Math.random(), m.angle + spread * (Math.random() - 0.5))
b.iceIX(25 + 32 * Math.random(), m.angle + spread * (Math.random() - 0.5))
}
} else if (tech.isFoamShot) {
const spread = (m.crouch ? 0.35 : 0.7)
@@ -3944,7 +3944,7 @@ const b = {
x: m.pos.x + 25 * Math.cos(m.angle),
y: m.pos.y + 25 * Math.sin(m.angle)
}
const number = 14 * (tech.isShotgunReversed ? 1.6 : 1)
const number = 13 * (tech.isShotgunReversed ? 1.6 : 1)
for (let i = 0; i < number; i++) {
const SPEED = 25 + 12 * Math.random();
const angle = m.angle + spread * (Math.random() - 0.5)
@@ -3952,7 +3952,7 @@ const b = {
}
} else if (tech.isNeedleShot) {
const number = 12 * (tech.isShotgunReversed ? 1.6 : 1)
const spread = (m.crouch ? 0.04 : 0.08)
const spread = (m.crouch ? 0.03 : 0.05)
let angle = m.angle - (number - 1) * spread * 0.5
for (let i = 0; i < number; i++) {
b.needle(angle)

View File

@@ -264,13 +264,13 @@ const build = {
el = document.getElementById("pause-grid-right")
el.style.display = "grid"
el.innerHTML = text
if (countTech > 5 || b.inventory.length > 6) {
document.body.style.overflowY = "scroll";
document.body.style.overflowX = "hidden";
}
// if (countTech > 5 || b.inventory.length > 6) {
// document.body.style.overflowY = "scroll";
// document.body.style.overflowX = "hidden";
// }
},
unPauseGrid() {
document.body.style.overflow = "hidden"
// document.body.style.overflow = "hidden"
document.getElementById("pause-grid-left").style.display = "none"
document.getElementById("pause-grid-right").style.display = "none"
window.scrollTo(0, 0);

View File

@@ -25,10 +25,10 @@ const level = {
// tech.giveTech("causality bombs")
// b.giveGuns("wave beam")
// tech.giveTech("phonon")
// tech.giveTech("bound state")
// tech.giveTech("cardinality")
// tech.giveTech("isotropic radiator")
// for (let i = 0; i < 9; i++) tech.giveTech("spherical harmonics")
// for (let i = 0; i < 3; i++) tech.giveTech("packet length")
// for (let i = 0; i < 4; i++) tech.giveTech()
level.intro(); //starting level
// level.testing(); //not in rotation, used for testing

View File

@@ -643,7 +643,7 @@ const m = {
simulation.makeTextLog(`<span class='color-var'>m</span>.<span class='color-r'>research</span><span class='color-symbol'>--</span><br>${powerUps.research.count}`)
for (let i = 0; i < 6; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false);
m.energy = m.maxEnergy
if (m.immuneCycle < m.cycle + 360) m.immuneCycle = m.cycle + 360 //disable this.immuneCycle bonus seconds
if (m.immuneCycle < m.cycle + 300) m.immuneCycle = m.cycle + 300 //disable this.immuneCycle bonus seconds
simulation.wipe = function() { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0.03)";
ctx.fillRect(0, 0, canvas.width, canvas.height);
@@ -672,7 +672,7 @@ const m = {
simulation.makeTextLog(`<span class='color-var'>m</span>.<span class='color-r'>research</span><span class='color-symbol'>--</span>
<br>${powerUps.research.count}`)
for (let i = 0; i < 6; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false);
if (m.immuneCycle < m.cycle + 360) m.immuneCycle = m.cycle + 360 //disable this.immuneCycle bonus seconds
if (m.immuneCycle < m.cycle + 300) m.immuneCycle = m.cycle + 300 //disable this.immuneCycle bonus seconds
simulation.wipe = function() { //set wipe to have trails
ctx.fillStyle = "rgba(255,255,255,0.03)";
ctx.fillRect(0, 0, canvas.width, canvas.height);

View File

@@ -160,10 +160,10 @@ const powerUps = {
document.getElementById("choose-grid").style.transitionDuration = "0s";
}, 500);
if (tech.isExtraChoice) {
document.body.style.overflowY = "scroll";
document.body.style.overflowX = "hidden";
}
// if (tech.isExtraChoice) {
// document.body.style.overflowY = "scroll";
// document.body.style.overflowX = "hidden";
// }
simulation.paused = true;
simulation.isChoosing = true; //stops p from un pausing on key down
build.pauseGrid(true)
@@ -206,7 +206,7 @@ const powerUps = {
document.getElementById("choose-background").style.opacity = "0"
document.body.style.cursor = "none";
document.body.style.overflow = "hidden"
// document.body.style.overflow = "hidden"
simulation.paused = false;
simulation.isChoosing = false; //stops p from un pausing on key down
if (m.immuneCycle < m.cycle + tech.collisionImmuneCycles) m.immuneCycle = m.cycle + tech.collisionImmuneCycles; //player is immune to damage for 30 cycles

View File

@@ -82,7 +82,7 @@
if (index === 'random') {
let options = [];
for (let i = 0; i < tech.tech.length; i++) {
if (tech.tech[i].count < tech.tech[i].maxCount && tech.tech[i].allowed() && !tech.tech[i].isJunk && !tech.tech[i].isLore) options.push(i);
if (tech.tech[i].count < tech.tech[i].maxCount && tech.tech[i].allowed() && !tech.tech[i].isJunk && !tech.tech[i].isLore && !tech.tech[i].isBadRandomOption) options.push(i);
}
// give a random tech from the tech I don't have
if (options.length > 0) {
@@ -3826,7 +3826,7 @@
},
{
name: "foam-shot",
description: "the <strong>shotgun</strong> fires <strong>14</strong> <strong>foam</strong> bubbles",
description: "the <strong>shotgun</strong> fires <strong>13</strong> <strong>foam</strong> bubbles",
isGunTech: true,
maxCount: 1,
count: 0,
@@ -3845,7 +3845,7 @@
},
{
name: "ice-shot",
description: "the <strong>shotgun</strong> fires <strong>16</strong> <strong class='color-s'>ice IX</strong> crystals",
description: "the <strong>shotgun</strong> fires <strong>18</strong> <strong class='color-s'>ice IX</strong> crystals",
isGunTech: true,
maxCount: 1,
count: 0,