more orbs in text

replaced tech, field, and gun text with orbs
  orbs length scale with px->em
cleaned up simulation variables text in pause menu
some minor tech description changes
total tech count no longer includes instant tech or removed tech

tech: planned obsolescence - at the start of each level eject your oldest tech and gain 1.1 damage

heuristics 1.3 -> between 1 and 1.5 fire rate
combinatorial optimization 1.35->1.4 damage

difficulty reduction per level
  0.85->0.87x damage done
  1.23->1.22 damage taken
This commit is contained in:
landgreen
2024-07-12 21:41:27 -07:00
parent 20f9b790de
commit fc70dfee2f
13 changed files with 529 additions and 873 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@@ -48,122 +48,10 @@
</svg>
<div id='info'>
<!-- <div id="constraint">
<details id = 'constraint-details'>
<summary>difficulty</summary>
<div class="details-div">
<style>
.grid-container {
display: grid;
grid-template-columns: 0fr 5fr 0fr;
line-height: 150%;
}
#difficulty-slider {
margin-top: 3rem;
height: 30rem;
width: 2rem;
writing-mode: vertical-lr;
/* direction: rtl; */
}
.far-right-column {
display: grid;
grid-template-rows: repeat(6, 1fr);
/* grid-gap: 55px; */
font-size: 2rem;
align-self: center;
justify-self: center;
}
.far-right-column > div{
padding-top: 60px;
}
.left-column {
grid-row: 1 / span 6
}
.right-column {
display: grid;
grid-template-rows: repeat(6, 1fr);
}
.row {
transition: opacity 0.4s ease-out;
border: 2px #000 solid;
margin-top: -2px;;
font-size: 1.2rem;
padding: 10px;
}
#constraint-0{
background-color: hsl(240, 18%, 98%);
border-radius: 10px 10px 0 0;
}
#constraint-1{
background-color: hsl(240, 18%, 96%);;
/* border-radius: 10px 10px 0 0; */
}
#constraint-2{
background-color: hsl(240, 18%, 94%);;
}
#constraint-3{
background-color: hsl(240, 18%, 92%);;
}
#constraint-4{
background-color: hsl(240, 18%, 90%);;
}
#constraint-5{
background-color: hsl(240, 18%, 88%);;
border-radius: 0 0 10px 10px;
}
</style>
<div class="grid-container">
<div class="left-column">
<input type="range" id="difficulty-slider" name="temp" type="range" step="1" value="0" min="0" max="5" list="values" />
<datalist id="values">
<option value="0"></option>
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
<option value="4"></option>
<option value="5"></option>
</datalist>
</div>
<div class="right-column">
<div class="row" id="constraint-0"><strong>2x</strong> <strong class='color-defense'>damage taken</strong> per level
<br><strong>0.82x</strong> <strong class='color-d'>damage</strong> per level</div>
<div class="row" id="constraint-1"><strong>-5</strong> initial <strong>power ups</strong>
<br><strong>5%</strong> chance for <strong>shielded</strong> mobs</div>
<div class="row" id="constraint-2"><strong>2x</strong> <strong class='color-defense'>damage taken</strong> per level
<br><strong>0.82x</strong> <strong class='color-d'>damage</strong> per level</div>
<div class="row" id="constraint-3"><strong>+1</strong> boss per level, <strong>-1</strong> <strong class='color-m'>tech</strong> per boss
<br><strong>1.5x</strong> mob movement and reactions</div>
<div class="row" id="constraint-4"><strong>2x</strong> <strong class='color-defense'>damage taken</strong> per level
<br><strong>0.82x</strong> <strong class='color-d'>damage</strong> per level</div>
<div class="row" id="constraint-5"><strong>10%</strong> chance for <strong>shielded</strong> mobs
<br><strong>-3</strong> initial power ups</div>
</div>
<div class="far-right-column">
<div id = "constraint-0-record"></div>
<div id = "constraint-1-record"></div>
<div id = "constraint-2-record"></div>
<div id = "constraint-3-record"></div>
<div id = "constraint-4-record"></div>
<div id = "constraint-5-record"></div>
</div>
</div>
confirm difficulty parameters
</div>
</details>
</div> -->
<div id="settings" >
<details id = 'settings-details'>
<summary>settings</summary>
<div style="line-height: 150%;" class="details-div">
<!-- <label for="difficulty-select" title="effects: number of mobs, damage done by mobs, damage done to mobs, mob speed, heal effects">combat difficulty:</label>
<select name="difficulty-select" id="difficulty-select" style="background-color: #fff">
<option value="1">easy</option>
<option value="2" selected>normal ⚆</option>
<option value="4">hard ⚆</option>
<option value="5">why ⚇</option>
</select>
<br> -->
<input onclick="build.showImages('settings')" type="checkbox" id="hide-images" name="hide-images" style="width:17px; height:17px;">
<label for="hide-images" title="hide images for fields, guns, and tech">hide images</label>
<br>
@@ -182,54 +70,9 @@
<br>
<input type="checkbox" id="community-maps" name="community-maps" style="width:17px; height:17px;">
<label for="community-maps" title="add about 18 player made levels to the random n-gon level pool">community maps</label>
<!-- style="font-size: 1.5em; color: #058;" -->
<!-- <br>
<label for="body-damage" title="allow damage from the ground and large fast moving blocks">collision damage from blocks:</label>
<input type="checkbox" id="body-damage" name="body-damage" checked style="width:17px; height:17px;"> -->
<br>
<label for="banned" title="type banned levels with a space between them. Example: run temple biohazard">banned levels:</label>
<input id="banned" name="banned" placeholder="list levels by name" autocomplete="off" spellcheck="false" style="width: 182px;" />
<!-- <input list="ban-suggest" id="banned" name="banned" placeholder="list levels by name" autocomplete="off" spellcheck="false" style="width: 182px;" />
<datalist id="ban-suggest">
<option value="testChamber">
<option value="lock">
<option value="sewers">
<option value="satellite">
<option value="aerie">
<option value="office">
<option value="highrise">
<option value="warehouse">
<option value="skyscrapers">
<option value="rooftops">
<option value="pavilion">
<option value="labs">
<option value="______">
<option value="fortress">
<option value="biohazard">
<option value="islands">
<option value="tunnel">
<option value="clock">
<option value="coliseum">
<option value="staircase">
<option value="perplex">
<option value="n-gon">
<option value="downpour">
<option value="buttonbutton">
<option value="vats">
<option value="underpass">
<option value="yingYang">
<option value="basement">
<option value="stronghold">
<option value="commandeer">
<option value="stereoMadness">
<option value="house">
<option value="dripp">
<option value="superNgonBros">
<option value="crossfire">
<option value="temple">
<option value="run">
</datalist> -->
<br>
<label for="classic-select" title="play older versions of n-gon">classic n-gon:</label>
<select name="classic-select" id="classic-select" onChange="window.location.href=this.value">
@@ -311,7 +154,6 @@
<tr>
<th>PAUSE</th>
<td id='key-pause' class='key-input'>P</td>
<!-- <td class='key-used'>Escape</td> -->
<td></td>
</tr>
<tr id="control-testing">
@@ -320,7 +162,6 @@
<td></td>
</tr>
</table>
<br><button id="control-reset" type="button">reset</button><span style="font-size: 60%;"> to default keys</span>
</div>
</details>
@@ -348,6 +189,7 @@
</details>
</div>
</div>
<svg id='splash' class="intro ui" viewBox="0 0 800 800" onclick="simulation.startGame()">
<g class="fade-in" transform="translate(100,210) scale(34)" fill='#afafaf' stroke='none'>
<path d="M0 0 h1 v0.2 h1.7 l0.3 0.3 v2.6 h-1 v-1.7 h-1 v1.7 h-1 z" />

View File

@@ -2286,14 +2286,9 @@ const b = {
//calculate laser collision
let range = tech.isPlasmaRange * (120 + (m.crouch ? 400 : 300) * Math.sqrt(Math.random())) //+ 100 * Math.sin(m.cycle * 0.3);
// const dir = m.angle // + 0.04 * (Math.random() - 0.5)
const path = [{
x: m.pos.x + 20 * Math.cos(m.angle),
y: m.pos.y + 20 * Math.sin(m.angle)
},
{
x: m.pos.x + range * Math.cos(m.angle),
y: m.pos.y + range * Math.sin(m.angle)
}
const path = [
{ x: m.pos.x + 20 * Math.cos(m.angle), y: m.pos.y + 20 * Math.sin(m.angle) },
{ x: m.pos.x + range * Math.cos(m.angle), y: m.pos.y + range * Math.sin(m.angle) }
];
//check for collisions
let best = {

View File

@@ -122,7 +122,7 @@ function collisionChecks(event) {
}
if (tech.isPiezo) m.energy += 20.48;
if (tech.isCouplingNoHit && m.coupling > 0) {
m.couplingChange(-4)
m.couplingChange(-3)
const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * Math.random())
let where = Vector.add(m.pos, Vector.mult(unit, 17))

View File

@@ -456,15 +456,17 @@ const build = {
generatePauseLeft() {
//left side
let botText = ""
if (tech.nailBotCount) botText += `<br>nail-bots: ${tech.nailBotCount}`
if (tech.orbitBotCount) botText += `<br>orbital-bots: ${tech.orbitBotCount}`
if (tech.boomBotCount) botText += `<br>boom-bots: ${tech.boomBotCount}`
if (tech.laserBotCount) botText += `<br>laser-bots: ${tech.laserBotCount}`
if (tech.foamBotCount) botText += `<br>foam-bots: ${tech.foamBotCount}`
if (tech.soundBotCount) botText += `<br>sound-bots: ${tech.soundBotCount}`
if (tech.dynamoBotCount) botText += `<br>dynamo-bots: ${tech.dynamoBotCount}`
if (tech.plasmaBotCount) botText += `<br>plasma-bots: ${tech.plasmaBotCount}`
if (tech.missileBotCount) botText += `<br>missile-bots: ${tech.missileBotCount}`
if (tech.nailBotCount) botText += `<br>nail-bots ${tech.nailBotCount}`
if (tech.orbitBotCount) botText += `<br>orbital-bots ${tech.orbitBotCount}`
if (tech.boomBotCount) botText += `<br>boom-bots ${tech.boomBotCount}`
if (tech.laserBotCount) botText += `<br>laser-bots ${tech.laserBotCount}`
if (tech.foamBotCount) botText += `<br>foam-bots ${tech.foamBotCount}`
if (tech.soundBotCount) botText += `<br>sound-bots ${tech.soundBotCount}`
if (tech.dynamoBotCount) botText += `<br>dynamo-bots ${tech.dynamoBotCount}`
if (tech.plasmaBotCount) botText += `<br>plasma-bots ${tech.plasmaBotCount}`
if (tech.missileBotCount) botText += `<br>missile-bots ${tech.missileBotCount}`
// <strong class='color-g'>${b.activeGun === null || b.activeGun === undefined ? "undefined" : b.guns[b.activeGun].name}</strong> (${b.activeGun === null || b.activeGun === undefined ? "0" : b.guns[b.activeGun].ammo})
let text = `<div class="pause-grid-module" style="padding: 8px;">
<span style="font-size:1.4em;font-weight: 600; float: left;">PAUSED</span>
@@ -482,24 +484,33 @@ const build = {
<details id = "simulation-variables-details" style="padding: 0 8px;line-height: 140%;">
<summary>simulation variables</summary>
<div class="pause-details">
<strong class='color-d'>damage</strong>: ${((tech.damageFromTech())).toPrecision(4)}x <span style="float: right;"><strong class='color-d'>difficulty:</strong> ${((m.dmgScale)).toPrecision(4)}x</span>
<br><strong class='color-defense'>damage taken</strong>: ${(m.defense()).toPrecision(4)}x <span style="float: right;"><strong class='color-defense'>difficulty:</strong> ${(simulation.dmgScale).toPrecision(4)}x</span>
<br><strong><em>fire rate</em></strong>: ${(1 / b.fireCDscale).toFixed(2)}x
${tech.duplicationChance() ? `<br><strong class='color-dup'>duplication</strong>: ${(tech.duplicationChance() * 100).toFixed(0)}%` : ""}
<strong class='color-d'>damage</strong> ${((tech.damageFromTech())).toPrecision(4)}x
<span style="float: right;"><strong class='color-d'>level</strong> ${((m.dmgScale)).toPrecision(4)}x</span>
<br><strong class='color-defense'>damage taken</strong> ${(m.defense()).toPrecision(4)}x
<span style="float: right;"><strong class='color-defense'>level</strong> ${(simulation.dmgScale).toPrecision(4)}x</span>
<br><strong class='color-h'>health</strong> (${(m.health * 100).toFixed(0)} / ${(m.maxHealth * 100).toFixed(0)})
<span style="float: right;">${powerUps.research.count} ${powerUps.orb.research()}</span>
<br><strong class='color-f'>energy</strong> (${(m.energy * 100).toFixed(0)} / ${(m.maxEnergy * 100).toFixed(0)}) + (${(m.fieldRegen * 6000).toFixed(0)}/s)
<span style="float: right;">${tech.totalCount} ${powerUps.orb.tech()}</span>
<br><strong><em>fire rate</em></strong> ${(1 / b.fireCDscale).toFixed(2)}x
<span style="float: right;">mass ${player.mass.toFixed(1)}</span>
${m.coupling ? `<br><span style = 'font-size:90%;'>` + m.couplingDescription(m.coupling) + `</span> from ${(m.coupling).toFixed(0)} ${powerUps.orb.coupling(1)}` : ""}
<br><strong class='color-dup'>duplication</strong> ${(tech.duplicationChance() * 100).toFixed(0)}%
<span style="float: right;"><strong class='color-junk'>JUNK</strong> ${(100 * tech.junkChance).toFixed(0)}%</span>
<br>
<br> ${level.levelAnnounce()}
<span style="float: right;">position (${player.position.x.toFixed(0)}, ${player.position.y.toFixed(0)})</span>
<br>seed ${Math.initialSeed}
<span style="float: right;">mouse (${simulation.mouseInGame.x.toFixed(0)}, ${simulation.mouseInGame.y.toFixed(0)})</span>
<br>cycles ${m.cycle}
<span style="float: right;">velocity (${player.velocity.x.toFixed(2)}, ${player.velocity.y.toFixed(2)})</span>
${botText}
<br><strong class='color-h'>health</strong>: (${(m.health * 100).toFixed(0)} / ${(m.maxHealth * 100).toFixed(0)})
<span style="float: right;">mass: ${player.mass.toFixed(1)}</span>
<br><strong class='color-f'>energy</strong>: (${(m.energy * 100).toFixed(0)} / ${(m.maxEnergy * 100).toFixed(0)}) + (${(m.fieldRegen * 6000).toFixed(0)}/s)
<span style="float: right;">position: (${player.position.x.toFixed(0)}, ${player.position.y.toFixed(0)})</span>
<br><strong class='color-g'>gun</strong>: ${b.activeGun === null || b.activeGun === undefined ? "undefined" : b.guns[b.activeGun].name} &nbsp; <strong class='color-g'>ammo</strong>: ${b.activeGun === null || b.activeGun === undefined ? "0" : b.guns[b.activeGun].ammo}
<span style="float: right;">mouse: (${simulation.mouseInGame.x.toFixed(0)}, ${simulation.mouseInGame.y.toFixed(0)})</span>
<br><strong class='color-m'>tech</strong>: ${tech.totalCount} &nbsp; <strong class='color-r'>research</strong>: ${powerUps.research.count}
<span style="float: right;">velocity: (${player.velocity.x.toFixed(2)}, ${player.velocity.y.toFixed(2)})</span>
${tech.junkChance ? `<br><strong class='color-junk'>JUNK</strong>: ${(100 * tech.junkChance).toFixed(1)}% ` : ""}
<br>mobs: ${spawn.pickList[0]}, ${spawn.pickList[0]}
<br>seed: ${Math.initialSeed} &nbsp; ${m.cycle} cycles
<br>mobs: ${mob.length} &nbsp; blocks: ${body.length} &nbsp; bullets: ${bullet.length} &nbsp; power ups: ${powerUp.length} ${simulation.isCheating ? "<br><br><em>lore disabled</em>" : ""}
<br>mobs ${mob.length} (${spawn.pickList[0]}, ${spawn.pickList[0]})
<span style="float: right;">blocks ${body.length}</span>
<br>bullets ${bullet.length}
<span style="float: right;">power ups ${powerUp.length}</span>
${simulation.isCheating ? "<br><br><em>lore disabled</em>" : ""}
</div>
</details>
</div>`
@@ -507,11 +518,11 @@ ${tech.junkChance ? `<br><strong class='color-junk'>JUNK</strong>: ${(100 * tech
<details id="difficulty-parameters-details" style="padding: 0 8px;">
<summary>difficulty parameters</summary>
<div class="pause-details">
${simulation.difficultyMode > 0 ? `<div class="pause-difficulty-row"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
${simulation.difficultyMode > 1 ? `<div class="pause-difficulty-row"><strong>-5</strong> initial <strong>power ups</strong><br><strong>faster</strong> and <strong>more</strong> mobs per level</div>` : " "}
${simulation.difficultyMode > 2 ? `<div class="pause-difficulty-row"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
${simulation.difficultyMode > 3 ? `<div class="pause-difficulty-row"><strong>+1</strong> boss per level<br><strong>-1</strong> <strong class='color-m'>tech</strong> per boss</div>` : " "}
${simulation.difficultyMode > 4 ? `<div class="pause-difficulty-row"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
${simulation.difficultyMode > 0 ? `<div class="pause-difficulty-row"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
${simulation.difficultyMode > 1 ? `<div class="pause-difficulty-row"><strong>-5</strong> initial <strong>power ups</strong><br><strong>faster</strong> mobs and <strong>more</strong> mobs</div>` : " "}
${simulation.difficultyMode > 2 ? `<div class="pause-difficulty-row"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
${simulation.difficultyMode > 3 ? `<div class="pause-difficulty-row"><strong>+1</strong> boss per level<br><strong>-1</strong> ${powerUps.orb.tech()} per boss</div>` : " "}
${simulation.difficultyMode > 4 ? `<div class="pause-difficulty-row"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>` : " "}
${simulation.difficultyMode > 5 ? `<div class="pause-difficulty-row"><strong>3x</strong> chance for <strong>shielded</strong> mobs<br><strong>-3</strong> initial power ups</div>` : " "}
</div>
</details>
@@ -571,13 +582,13 @@ ${tech.junkChance ? `<br><strong class='color-junk'>JUNK</strong>: ${(100 * tech
},
generatePauseRight() {
let text = `<div class="sort">
<button onclick="build.sortTech('guntech')" class='sort-button'>${powerUps.orb.gunTech()}</button>
<button onclick="build.sortTech('fieldtech')" class='sort-button'>${powerUps.orb.fieldTech()}</button>
<button onclick="build.sortTech('damage')" class='sort-button'><strong class='color-d'>damage</strong></button>
<button onclick="build.sortTech('guntech')" class='sort-button'><strong class='color-g'>gun</strong><strong class='color-m'>tech</strong></button>
<button onclick="build.sortTech('fieldtech')" class='sort-button'><strong class='color-f'>field</strong><strong class='color-m'>tech</strong></button>
<button onclick="build.sortTech('damage taken')" class='sort-button'><strong style="letter-spacing: 1px;font-weight: 100;">dmg taken</strong></button>
<button onclick="build.sortTech('heal')" class='sort-button'><strong class='color-h'>heal</strong></button>
<button onclick="build.sortTech('damage taken')" class='sort-button'><strong style="letter-spacing: 1px;font-weight: 100;">damage taken</strong></button>
<button onclick="build.sortTech('energy')" class='sort-button'><strong class='color-f'>energy</strong></button>
<input type="search" id="sort-input" style="width: 5em;font-size: 0.6em;color:#000;" placeholder="sort by" />
<input type="search" id="sort-input" style="width: 8em;font-size: 0.6em;color:#000;" placeholder="sort by" />
<button onclick="build.sortTech('input')" class='sort-button' style="border-radius: 0em;border: 1.5px #000 solid;font-size: 0.6em;" value="damage">sort</button>
</div>`;
const ejectClass = (tech.isPauseEjectTech && !simulation.isChoosing) ? 'pause-eject' : ''
@@ -926,13 +937,13 @@ ${tech.junkChance ? `<br><strong class='color-junk'>JUNK</strong>: ${(100 * tech
let text = `
<div class="experiment-start-box">
<div class="sort" style="border: 0px;">
<button onclick="build.sortTech('guntech', true)" class='sort-button'><strong class='color-g'>gun</strong><strong class='color-m'>tech</strong></button>
<button onclick="build.sortTech('fieldtech', true)" class='sort-button'><strong class='color-f'>field</strong><strong class='color-m'>tech</strong></button>
<button onclick="build.sortTech('guntech', true)" class='sort-button'>${powerUps.orb.gunTech()}</button>
<button onclick="build.sortTech('fieldtech', true)" class='sort-button'>${powerUps.orb.fieldTech()}</button>
<button onclick="build.sortTech('damage', true)" class='sort-button'><strong class='color-d'>damage</strong></button>
<button onclick="build.sortTech('energy')" class='sort-button'><strong class='color-f'>energy</strong></button>
<button onclick="build.sortTech('damage taken', true)" class='sort-button'><strong style="letter-spacing: 1px;font-weight: 100;">damage taken</strong></button>
<button onclick="build.sortTech('damage taken', true)" class='sort-button'><strong style="letter-spacing: 1px;font-weight: 100;">dmg taken</strong></button>
<button onclick="build.sortTech('heal')" class='sort-button'><strong class='color-h'>heal</strong></button>
<input type="search" id="sort-input" style="width: 6em;font-size: 0.6em;color:#000;" placeholder="sort by" />
<button onclick="build.sortTech('energy')" class='sort-button'><strong class='color-f'>energy</strong></button>
<input type="search" id="sort-input" style="width: 7.5em;font-size: 0.6em;color:#000;" placeholder="sort by" />
<button onclick="build.sortTech('input', true)" class='sort-button' style="border-radius: 0em;border: 1.5px #000 solid;font-size: 0.6em;" value="damage">sort</button>
</div>
<div>

View File

@@ -26,7 +26,7 @@ const level = {
// tech.tech[297].frequency = 100
// tech.addJunkTechToPool(0.5)
// m.couplingChange(10)
// m.setField("negative mass") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole 10 grappling hook
// m.setField("plasma torch") //1 standing wave 2 perfect diamagnetism 3 negative mass 4 molecular assembler 5 plasma torch 6 time dilation 7 metamaterial cloaking 8 pilot wave 9 wormhole 10 grappling hook
// m.energy = 0
// powerUps.research.count = 3
// tech.isHookWire = true
@@ -36,29 +36,28 @@ const level = {
// b.giveGuns("super balls") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("shotgun") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("wave") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("laser") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// b.giveGuns("wave") //0 nail gun 1 shotgun 2 super balls 3 wave 4 missiles 5 grenades 6 spores 7 drones 8 foam 9 harpoon 10 mine 11 laser
// tech.laserColor = "#fff"
// tech.laserColorAlpha = "rgba(255, 255, 255, 0.5)"
// b.guns[8].ammo = 100000000
// requestAnimationFrame(() => { tech.giveTech("optical amplifier") });
// requestAnimationFrame(() => { tech.giveTech("stimulated emission") });
// tech.giveTech("1st ionization energy")
// for (let i = 0; i < 1; ++i) tech.giveTech("tokamak")
// for (let i = 0; i < 1; ++i) tech.giveTech("inertial confinement")
// for (let i = 0; i < 1; ++i) tech.giveTech("stellarator")
// for (let i = 0; i < 1; ++i) tech.giveTech("mass-energy equivalence")
// requestAnimationFrame(() => { for (let i = 0; i < 10; i++) b.orbitBot(m.pos, false) });
// requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("1st ionization energy") });
// for (let i = 0; i < 1; i++) tech.giveTech("tungsten carbide")
// for (let i = 0; i < 1; ++i) tech.giveTech("booby trap")
// for (let i = 0; i < 1; ++i) tech.giveTech("obsolescence")
// for (let i = 0; i < 1; ++i) tech.giveTech("arsenal")
// requestAnimationFrame(() => { for (let i = 0; i < 3; i++) tech.giveTech("mechatronics") });
// requestAnimationFrame(() => { for (let i = 0; i < 1; i++) tech.giveTech("paradigm shift") });
// for (let i = 0; i < 2; i++) tech.giveTech("nail-bot")
// m.lastKillCycle = m.cycle
// for (let i = 0; i < 1; ++i) tech.giveTech("compression engine")
// for (let i = 0; i < 1; ++i) tech.giveTech("cross-disciplinary")
// for (let i = 0; i < 3; i++) powerUps.directSpawn(450, -50, "tech");
// for (let i = 0; i < 1; i++) powerUps.directSpawn(-50, -70, "difficulty", false);
// spawn.mapRect(575, -700, 25, 425); //block mob line of site on testing
// level.testing();
// for (let i = 0; i < 1; ++i) spawn.snakeBoss(1400, -500)
// for (let i = 0; i < 2; i++) powerUps.directSpawn(800, -100, "coupling");
// for (let i = 0; i < 20; i++) powerUps.directSpawn(0, 0, "coupling");
// Matter.Body.setPosition(player, { x: -200, y: -3330 });
// for (let i = 0; i < 4; ++i) spawn.sucker(1300, -500 + 100 * Math.random())
// spawn.hopper(1900, -500)
@@ -112,7 +111,10 @@ const level = {
if (localSettings.isAllowed) localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
}
}
if (!simulation.isTraining) level.levelAnnounce();
if (!simulation.isTraining) {
document.title = "n-gon: " + level.levelAnnounce();
simulation.makeTextLog(`<span class='color-var'>level</span>.onLevel <span class='color-symbol'>=</span> "<span class='color-text'>${level.levels[level.onLevel]}</span>"`);
}
simulation.setupCamera(player.position);
simulation.setZoom();
level.addToWorld(); //add bodies to game engine
@@ -204,6 +206,19 @@ const level = {
// if (h > healPerOrb) powerUps.spawnDelay("heal", h);
// simulation.makeTextLog(`${(Math.ceil(tech.interestRate * 100)).toFixed(0)}<span class='color-symbol'>%</span> <span class='color-m'>interest</span> on <span class='color-h'>health</span> <span class='color-symbol'>=</span> ${h > 20 ? h + powerUps.orb.heal(1) : powerUps.orb.heal(h)}`)
}
if (tech.ejectOld > 0) {
let index = null //find oldest tech that you have
for (let i = 0; i < tech.tech.length; i++) {
if (tech.tech[i].count > 0) index = i
}
if (index) { //eject it
const effect = Math.pow(1.1, tech.tech[index].count)
simulation.makeTextLog(`<strong>${(effect).toFixed(2)}x</strong> <strong class='color-d'>damage</strong> <em>//from obsolescence</em>`, 360)
tech.damage *= effect
tech.ejectOld *= effect
powerUps.ejectTech(index)
}
}
},
trainingText(say) {
simulation.lastLogTime = 0; //clear previous messages
@@ -241,8 +256,8 @@ const level = {
} else if (simulation.difficultyMode > 1) {
scale = 2
}
m.dmgScale = Math.pow(0.85, level.levelsCleared * scale)
simulation.dmgScale = Math.max(0.1, 0.23 * level.levelsCleared * scale) //damage done by mobs scales with total levels
m.dmgScale = Math.pow(0.87, level.levelsCleared * scale)
simulation.dmgScale = Math.max(0.1, 0.22 * level.levelsCleared * scale) //damage done by mobs scales with total levels
//
simulation.healScale = 1 / (1 + simulation.difficulty * 0.043) //a higher denominator makes for lower heals // m.health += heal * simulation.healScale;
@@ -268,10 +283,9 @@ const level = {
levelAnnounce() {
const cheating = simulation.isCheating ? "(testing)" : ""
if (level.levelsCleared === 0) {
document.title = `n-gon: initial ${cheating}`;
return `initial ${cheating}`;
} else {
document.title = `n-gon: ${level.levelsCleared} ${level.levels[level.onLevel]} ${cheating}`
simulation.makeTextLog(`<span class='color-var'>level</span>.onLevel <span class='color-symbol'>=</span> "<span class='color-text'>${level.levels[level.onLevel]}</span>"`);
return `${level.levelsCleared} ${level.levels[level.onLevel]} ${cheating}`
}
},
announceMobTypes() {
@@ -624,13 +638,12 @@ const level = {
let text = `
<div class="choose-grid-module" id = "choose-training" style = "font-size: 1em; padding:10px;color:#333;">
<h2 style="text-align: center;letter-spacing: 5px;">training</h2>
Begin the <strong>guided tutorial</strong> that shows you how to use your <strong class='color-f'>field</strong> and <strong class='color-g'>gun</strong>.
Begin the <strong>guided tutorial</strong> that shows you how to use your ${powerUps.field.gun()} and ${powerUps.orb.gun()}.
</div>
<div class="choose-grid-module" id = "choose-unPause" style = "font-size: 1em; padding:10px;color:#333;">
<h2 style="text-align: center; letter-spacing: 7px;">play</h2>
Begin the <strong>standard game</strong> where you progress through <strong>13</strong> random levels and beat the final boss.
</div>`
//use you use your <strong class='color-g'>gun</strong>, <strong class='color-f'>field</strong>, and <strong class='color-m'>tech</strong>
document.getElementById("choose-grid").innerHTML = text
//show level info
document.getElementById("choose-grid").style.opacity = "1"
@@ -4089,9 +4102,10 @@ const level = {
} else {
isSpawnedBoss = true
isDoorsLocked = true
for (let i = 0; i < 9; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1700, "ammo")
for (let i = 0; i < 3; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1700, "heal");
const scale = Math.pow(simulation.difficulty, 0.7) //hard around 30, why around 54
for (let i = 0; i < 12; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1800, "ammo")
for (let i = 0; i < 5; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1700, "heal");
for (let i = 0; i < 1; ++i) powerUps.spawn(-1800 + 550 * Math.random(), -1750, "research");
const scale = Math.pow(simulation.difficulty, 0.7)
if (mobs.mobDeaths < level.levelsCleared && !simulation.isCheating) {
for (let i = 0; i < 250; i++) spawn.starter(-2700 + 2400 * Math.random(), -1300 - 500 * Math.random())
} else {
@@ -4112,7 +4126,6 @@ const level = {
}
}
}
// spawn.secondaryBossChance(-2300, -800)
}
} else {
doorIn.isClosing = false
@@ -31938,7 +31951,7 @@ const level = {
}
if (tech.isPiezo) g.energy += 20.48;
if (tech.isCouplingNoHit && g.coupling > 0) {
g.couplingChange(-5)
g.couplingChange(-3)
const unit = Vector.rotate({ x: 1, y: 0 }, 6.28 * Math.random())
let where = Vector.add(g.pos, Vector.mult(unit, 17))
@@ -34513,27 +34526,27 @@ const level = {
const buttonDoor = level.button(400, 0)
let instruction = 0
level.trainingText(`use your <strong class='color-f'>field</strong> to pick up the gun power up`)
level.trainingText(`use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}`)
level.custom = () => {
if (instruction === 0 && simulation.isChoosing) {
instruction++
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up the gun power up</s>
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}</s>
<br>choose a <strong class='color-g'>gun</strong>`)
} else if (instruction === 1 && !simulation.isChoosing) {
instruction++
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up the gun power up
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}
<br>choose a <strong class='color-g'>gun</strong></s>
<br>use the <strong>left mouse</strong> button to shoot the <strong>mobs</strong>`)
} else if (instruction === 2 && mob.length === 0) {
instruction++
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up the gun power up
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}
<br>choose a <strong class='color-g'>gun</strong>
<br>use the <strong>left mouse</strong> button to shoot the <strong>mobs</strong></s>
<br>drop a <strong class='color-block'>block</strong> on the red button to open the door`)
} else if (instruction === 3 && !door.isClosing) {
instruction++
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up the gun power up
level.trainingText(`<s>use your <strong class='color-f'>field</strong> to pick up ${powerUps.orb.gun()}
<br>choose a <strong class='color-g'>gun</strong>
<br>use the <strong>left mouse</strong> button to shoot the <strong>mobs</strong>
<br>put a <strong class='color-block'>block</strong> on the red button to open the door</s>`)

View File

@@ -699,7 +699,7 @@ const m = {
tech.isDeathAvoidedThisLevel = true
powerUps.research.changeRerolls(-1)
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 < 16; i++) powerUps.spawn(m.pos.x + 100 * (Math.random() - 0.5), m.pos.y + 100 * (Math.random() - 0.5), "heal", false);
for (let i = 0; i < 22; 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 + 0.1
if (m.immuneCycle < m.cycle + 300) m.immuneCycle = m.cycle + 300 //disable this.immuneCycle bonus seconds
simulation.wipe = function () { //set wipe to have trails
@@ -2156,7 +2156,6 @@ const m = {
m.fieldBlockCD = 10;
m.fieldDamage = 1
m.fieldHarmReduction = 1;
m.lastHit = 0
m.isSneakAttack = false
m.duplicateChance = 0
m.grabPowerUpRange2 = 200000;
@@ -2890,7 +2889,7 @@ const m = {
couplingDescription(couple = m.coupling) {
switch (m.fieldMode) {
case 0: //field emitter
return `<strong>all</strong> other <strong class='color-f'>field</strong> effects`
return `<strong>all</strong> effects`
case 1: //standing wave
// return `<span style = 'font-size:95%;'><strong>deflecting</strong> condenses +${couple.toFixed(1)} <strong class='color-s'>ice IX</strong></span>`
return `+${(couple * 5).toFixed(0)} maximum <strong class='color-f'>energy</strong>`
@@ -3091,7 +3090,7 @@ const m = {
},
{
name: "perfect diamagnetism",
description: "<strong>deflecting</strong> does not drain <strong class='color-f'>energy</strong><br><strong>shield</strong> maintains <strong>functionality</strong> while inactive<br><strong>5</strong> <strong class='color-f'>energy</strong> per second",
description: `<strong>deflecting</strong> does not drain <strong class='color-f'>energy</strong><br><strong>shield</strong> maintains <strong>functionality</strong> while inactive<br><strong>5</strong> <strong class='color-f'>energy</strong> per second`,
effect: () => {
m.fieldMeterColor = "#48f" //"#0c5"
m.eyeFillColor = m.fieldMeterColor
@@ -3326,7 +3325,7 @@ const m = {
{
name: "negative mass",
//<br>hold <strong class='color-block'>blocks</strong> as if they have a lower <strong>mass</strong>
description: "use <strong class='color-f'>energy</strong> to nullify &nbsp;<strong style='letter-spacing: 7px;'>gravity</strong><br><strong>0.4x</strong> <strong class='color-defense'>damage taken</strong><br><strong>6</strong> <strong class='color-f'>energy</strong> per second",
description: `use <strong class='color-f'>energy</strong> to nullify &nbsp;<strong style='letter-spacing: 7px;'>gravity</strong><br><strong>0.4x</strong> <strong class='color-defense'>damage taken</strong><br><strong>6</strong> <strong class='color-f'>energy</strong> per second`,
fieldDrawRadius: 0,
effect: () => {
m.fieldFire = true;
@@ -3572,7 +3571,7 @@ const m = {
bullet[bullet.length - 1].force.y += 0.005 + push.y * (Math.random() - 0.5)
// b.missile({ x: m.pos.x, y: m.pos.y - 40 }, -Math.PI / 2 + 0.5 * (Math.random() - 0.5), 0, 1)
} else if (simulation.molecularMode === 2) {
m.energy -= 0.045;
m.energy -= 0.044;
b.iceIX(1)
} else if (simulation.molecularMode === 3) {
if (tech.isDroneRadioactive) {
@@ -4091,7 +4090,7 @@ const m = {
},
{
name: "time dilation",
description: "use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 2px;'>stop time</strong><br><strong>1.2x</strong> movement and <strong><em>fire rate</em></strong><br><strong>12</strong> <strong class='color-f'>energy</strong> per second",
description: `use <strong class='color-f'>energy</strong> to <strong style='letter-spacing: 2px;'>stop time</strong><br><strong>1.2x</strong> movement and <strong><em>fire rate</em></strong><br><strong>12</strong> <strong class='color-f'>energy</strong> per second`,
set() {
// m.fieldMeterColor = "#0fc"
// m.fieldMeterColor = "#ff0"
@@ -4290,7 +4289,7 @@ const m = {
},
{
name: "metamaterial cloaking",
description: "<strong>0.3x</strong> <strong class='color-defense'>damage taken</strong> while <strong class='color-cloaked'>cloaked</strong><br>after <strong class='color-cloaked'>decloaking</strong> <strong>4.5x</strong> <strong class='color-d'>damage</strong> for <strong>2</strong> s<br><strong>6</strong> <strong class='color-f'>energy</strong> per second",
description: `<strong>0.3x</strong> <strong class='color-defense'>damage taken</strong> while <strong class='color-cloaked'>cloaked</strong><br>after <strong class='color-cloaked'>decloaking</strong> <strong>4.5x</strong> <strong class='color-d'>damage</strong> for <strong>2</strong> s<br><strong>6</strong> <strong class='color-f'>energy</strong> per second`,
effect: () => {
m.fieldFire = true;
m.fieldMeterColor = "#333";
@@ -4451,10 +4450,7 @@ const m = {
},
{
name: "pilot wave",
//<br><strong class='color-block'>blocks</strong> can't <strong>collide</strong> with <strong>intangible</strong> mobs
//field <strong>radius</strong> decreases out of <strong>line of sight</strong>
//<strong>unlock</strong> <strong class='color-m'>tech</strong> from other <strong class='color-f'>fields</strong>
description: "use <strong class='color-f'>energy</strong> to guide <strong class='color-block'>blocks</strong><br><strong class='color-m'>tech</strong>, <strong class='color-f'>fields</strong>, and <strong class='color-g'>guns</strong> have <strong>+3</strong> <strong class='color-choice'><span>ch</span><span>oi</span><span>ces</span></strong><br><strong>10</strong> <strong class='color-f'>energy</strong> per second",
description: `use <strong class='color-f'>energy</strong> to guide <strong class='color-block'>blocks</strong><br><div class="circle-grid tech"></div>, <div class="circle-grid gun"></div>, and <div class="circle-grid field"></div> have <strong>+3</strong> <strong class='color-choice'><span>ch</span><span>oi</span><span>ces</span></strong><br><strong>10</strong> <strong class='color-f'>energy</strong> per second`,
effect: () => {
m.fieldMeterColor = "#333"
m.eyeFillColor = m.fieldMeterColor
@@ -5231,13 +5227,13 @@ const m = {
},
{
name: "grappling hook",
description: `use <strong class='color-f'>energy</strong> to fire a hook that <strong>pulls</strong> you<br><strong>0.6x</strong> <strong class='color-defense'>damage taken</strong><br><strong>9</strong> <strong class='color-f'>energy</strong> per second`,
description: `use <strong class='color-f'>energy</strong> to fire a hook that <strong>pulls</strong> you<br><strong>0.5x</strong> <strong class='color-defense'>damage taken</strong><br><strong>9</strong> <strong class='color-f'>energy</strong> per second`,
effect: () => {
m.fieldFire = true;
// m.holdingMassScale = 0.01; //can hold heavier blocks with lower cost to jumping
// m.fieldMeterColor = "#789"//"#456"
m.eyeFillColor = m.fieldMeterColor
m.fieldHarmReduction = 0.6; //40% reduction
m.fieldHarmReduction = 0.5; //40% reduction
m.grabPowerUpRange2 = 300000 //m.grabPowerUpRange2 = 200000;
m.hold = function () {

View File

@@ -34,48 +34,10 @@ const powerUps = {
healGiveMaxEnergy: false, //for tech 1st ionization energy
orb: {
research(num = 1) {
switch (num) {
case 1:
return `<div class="research-circle"></div> `
case 2:
return `<span style="position:relative;">
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:7px;"></div>
</span> &nbsp; &nbsp; &nbsp; &nbsp;`
case 3:
return `<span style="position:relative;">
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:8px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:16px;"></div>
</span> &nbsp; &nbsp; &nbsp; &nbsp; &thinsp; `
case 4:
return `<span style="position:relative;">
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:8px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:16px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:24px;"></div>
</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `
case 5:
return `<span style="position:relative;">
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:8px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:16px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:24px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:32px;"></div>
</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `
case 6:
return `<span style="position:relative;">
<div class="research-circle" style="position:absolute; top:1.5px; left:0;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:8px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:16px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:24px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:32px;"></div>
<div class="research-circle" style="position:absolute; top:1.5px; left:40px;"></div>
</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `
}
if (num === 1) return `<div class="research-circle"></div> `
let text = '<span style="position:relative;">'
for (let i = 0; i < num; i++) {
text += `<div class="research-circle" style="position:absolute; top:1.5px; left:${i * 8}px;"></div>`
text += `<div class="research-circle" style="position:absolute; top:1.5px; left:${i * 0.6}em;"></div>`
}
text += '</span> &nbsp; &nbsp; '
for (let i = 0; i < num; i++) {
@@ -90,7 +52,7 @@ const powerUps = {
}
let text = '<span style="position:relative;">'
for (let i = 0; i < num; i++) {
text += `<div class="ammo-circle" style="position:absolute; top:1.5px; left:${i * 8}px;"></div>`
text += `<div class="ammo-circle" style="position:absolute; top:1.5px; left:${i * 0.6}em;"></div>`
}
text += '</span> &nbsp; &nbsp; '
for (let i = 0; i < num; i++) {
@@ -100,37 +62,43 @@ const powerUps = {
},
heal(num = 1) {
if (powerUps.healGiveMaxEnergy) {
switch (num) {
case 1:
return `<div class="heal-circle-energy"></div>`
}
if (num === 1) return `<div class="heal-circle-energy"></div>`
let text = '<span style="position:relative;">'
for (let i = 0; i < num; i++) {
text += `<div class="heal-circle-energy" style="position:absolute; top:1px; left:${i * 10}px;"></div>`
text += `<div class="heal-circle-energy" style="position:absolute; top:1px; left:${i * 0.6}em;"></div>`
}
text += '</span> &nbsp; &nbsp; '
for (let i = 0; i < num; i++) {
text += '&nbsp; '
}
for (let i = 0; i < num; i++) text += '&nbsp; '
return text
} else {
switch (num) {
case 1:
return `<div class="heal-circle"></div>`
}
if (num === 1) return `<div class="heal-circle"></div>`
let text = '<span style="position:relative;">'
for (let i = 0; i < num; i++) {
text += `<div class="heal-circle" style="position:absolute; top:1px; left:${i * 10}px;"></div>`
text += `<div class="heal-circle" style="position:absolute; top:1px; left:${i * 0.6}em;"></div>`
}
text += '</span> &nbsp; &nbsp; '
for (let i = 0; i < num; i++) {
text += '&nbsp; '
}
for (let i = 0; i < num; i++) text += '&nbsp; '
return text
}
},
tech(num = 1) {
return `<div class="tech-circle"></div>`
return `<div class="circle-grid tech" style="width: 1.32em; height: 1.32em;margin-bottom: -0.3em;"></div>`
},
field(num = 1) {
return `<div class="circle-grid field"></div>`
},
gun(num = 1) {
return `<div class="circle-grid gun"></div>`
},
gunTech(num = 1) {
return `<div class="circle-grid tech" style="position:relative; top:-0.05em; left:0.55em;opacity:0.8;margin-left:-0.55em;"></div>
<div class="circle-grid gun" style="position:relative; top:-0.05em; left:-0.55em; opacity:0.65;margin-right:-0.55em;"></div>`
},
fieldTech(num = 1) {
return `<div class="circle-grid tech" style="position:relative; top:-0.05em; left:0.55em;opacity:0.8;margin-left:-0.55em;"></div>
<div class="circle-grid field" style="position:relative; top:-0.05em; left:-0.55em;opacity:0.65;margin-right:-0.55em;"></div>`
},
coupling(num = 1) {
switch (num) {
@@ -139,7 +107,7 @@ const powerUps = {
}
let text = '<span style="position:relative;">'
for (let i = 0; i < num; i++) {
text += `<div class="coupling-circle" style="position:absolute; top:1.5px; left:${i * 6}px;"></div>`
text += `<div class="coupling-circle" style="position:absolute; top:1.5px; left:${i * 0.5}em;"></div>`
}
text += '</span> &nbsp; &nbsp;'
for (let i = 0; i < num; i++) {
@@ -421,11 +389,11 @@ const powerUps = {
</datalist>
</div>
<div class="right-column">
<div class="row" id="constraint-1"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
<div class="row" id="constraint-2"><strong>-5</strong> initial <strong>power ups</strong><br><strong>faster</strong> and <strong>more</strong> mobs per level</div>
<div class="row" id="constraint-3"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
<div class="row" id="constraint-4"><strong>+1</strong> boss per level<br><strong>-1</strong> <strong class='color-m'>tech</strong> per boss</div>
<div class="row" id="constraint-5"><strong>0.85x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.23x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
<div class="row" id="constraint-1"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
<div class="row" id="constraint-2"><strong>-5</strong> initial <strong>power ups</strong><br><strong>faster</strong> mobs and <strong>more</strong> mobs</div>
<div class="row" id="constraint-3"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
<div class="row" id="constraint-4"><strong>+1</strong> boss per level<br><strong>-1</strong> ${powerUps.orb.tech()} per boss</div>
<div class="row" id="constraint-5"><strong>0.87x</strong> <strong class='color-d'>damage</strong> done per level<br><strong>1.22x</strong> <strong class='color-defense'>damage taken</strong> per level</div>
<div class="row" id="constraint-6"><strong>3x</strong> chance for <strong>shielded</strong> mobs<br><strong>-3</strong> initial power ups</div>
</div>
<div class="far-right-column">
@@ -1602,6 +1570,7 @@ const powerUps = {
// remove a random tech from the list of tech you have
tech.removeCount += tech.tech[choose].count
tech.tech[choose].remove();
tech.totalCount -= tech.tech[choose].count
tech.tech[choose].count = 0;
tech.tech[choose].isLost = true;
simulation.updateTechHUD();
@@ -1619,6 +1588,7 @@ const powerUps = {
}
// remove a random tech from the list of tech you have
tech.tech[choose].remove();
tech.totalCount -= tech.tech[choose].count
tech.removeCount += tech.tech[choose].count
tech.tech[choose].count = 0;
tech.tech[choose].isLost = true;

View File

@@ -830,6 +830,7 @@ const simulation = {
simulation.wipe = function () { //set wipe to normal
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
m.lastHit = 0
m.hole.isOn = false
simulation.paused = false;
engine.timing.timeScale = 1;

View File

@@ -5530,7 +5530,7 @@ const spawn = {
me.torqueMagnitude = 0.00024 * me.inertia * (Math.random() > 0.5 ? -1 : 1);
me.delay = 70 + 70 * simulation.CDScale;
me.cd = 0;
me.swordRadius = 0;
me.swordRadius = 50;
me.swordVertex = 1
me.swordRadiusMax = 1100 + 20 * simulation.difficulty;
me.swordRadiusGrowRate = me.swordRadiusMax * (0.005 + 0.0003 * simulation.difficulty)
@@ -5564,15 +5564,16 @@ const spawn = {
Matter.Query.ray(body, this.position, this.playerPosRandomY()).length === 0
) {
//find vertex farthest away from player
let dist = 0
for (let i = 0, len = this.vertices.length; i < len; i++) {
const D = Vector.magnitudeSquared(Vector.sub({ x: this.vertices[i].x, y: this.vertices[i].y }, m.pos))
if (D > dist) {
dist = D
this.swordVertex = i
}
}
this.laserAngle = this.swordVertex / 5 * 2 * Math.PI + 0.6283
// let dist = 0
// for (let i = 0, len = this.vertices.length; i < len; i++) {
// const D = Vector.magnitudeSquared(Vector.sub({ x: this.vertices[i].x, y: this.vertices[i].y }, m.pos))
// if (D > dist) {
// dist = D
// this.swordVertex = i
// }
// }
// this.laserAngle = this.swordVertex / 5 * 2 * Math.PI + 0.6283
this.sword = this.swordGrow
Matter.Body.setVelocity(this, { x: 0, y: 0 });
Matter.Body.setAngularVelocity(this, 0)
@@ -5581,6 +5582,7 @@ const spawn = {
this.isInvulnerable = true
this.frictionAir = 1
}
this.laserSword(this.vertices[this.swordVertex], this.angle + this.laserAngle); //always see the tip of the sword
}
me.sword = me.swordWaiting //base function that changes during different aspects of the sword swing
me.swordGrow = function () {
@@ -5606,7 +5608,7 @@ const spawn = {
this.spinCount++
if (this.spinCount > 80) {
this.sword = this.swordWaiting
this.swordRadius = 0
this.swordRadius = 50
this.accelMag = 0.001 * simulation.accelScale;
this.cd = simulation.cycle + this.delay;
this.damageReduction = this.startingDamageReduction

File diff suppressed because it is too large Load Diff

View File

@@ -184,15 +184,11 @@ summary {
scrollbar-width: none;
}
.choose-grid-no-images {
border-radius: 8px;
border: 10px solid #444;
gap: 10px;
background-color: #444;
/* padding: 10px 1px; */
position: absolute;
top: 50%;
left: 50%;
@@ -222,9 +218,6 @@ summary {
line-height: 160%;
background-color: var(--card-color);
font-size: 0.75em;
/* transform-style: preserve-3d;
transition: transform 2s;
transform: rotateX(180deg); */
}
.choose-grid-module:hover {
@@ -259,9 +252,7 @@ summary {
overflow: auto;
max-height: 100vh;
-ms-overflow-style: none;
/* IE and Edge */
scrollbar-width: none;
/* Firefox */
padding: 1px;
}
@@ -276,21 +267,9 @@ summary {
overflow: auto;
max-height: 100vh;
-ms-overflow-style: none;
/* IE and Edge */
scrollbar-width: none;
/* Firefox */
}
/* .pause-console { */
/* padding: 10px; */
/* margin: 10px; */
/* border-radius: 10px; */
/* line-height: 140%; */
/* font-size: 1em; */
/* padding: 10px; */
/* margin: -5px 0; */
/* } */
#pause-grid-left::-webkit-scrollbar {
display: none;
}
@@ -581,6 +560,10 @@ summary {
z-index: 12;
font-size: 1.5em;
transition: opacity 5s ease-in;
/* border: 1.5px #333 solid; */
/* border-radius: 8px; */
/* background-color: #fff; */
}
.details-div {
@@ -588,20 +571,9 @@ summary {
border-radius: 8px;
border: 2px #333 solid;
background-color: #fff;
/* box-shadow: 8px 8px 6px rgba(0, 0, 60, 0.11); */
}
#dmg {
position: absolute;
z-index: 2;
@@ -757,6 +729,7 @@ summary {
/* transition: opacity 0.15s; */
pointer-events: none;
user-select: none;
/* font-family: monospace; */
}
.color-text {
@@ -998,13 +971,27 @@ summary {
}
.circle-grid {
width: 1.35em;
height: 1.35em;
width: 1.32em;
height: 1.32em;
border-radius: 50%;
display: inline-block;
margin-bottom: -0.3em;
}
.circle-grid-big {
/* width: 1.7em;
height: 1.7em;
border-radius: 50%;
display: inline-block;
margin-bottom: -0.5em -0.5em -0.5em -0.5em; */
width: 1.32em;
height: 1.32em;
border-radius: 50%;
display: inline-block;
margin-bottom: -0.3em;
transform: scale(1.5);
}
.circle-grid-instant {
width: 1.1em;
height: 1.1em;
@@ -1660,7 +1647,7 @@ summary {
}
.pause-details {
background-color: hsl(240, 18%, 93%);
background-color: #e2e9ec;
border: 1px solid #333;
border-radius: 5px;
padding: 7px;

286
todo.txt
View File

@@ -1,53 +1,40 @@
******************************************************** NEXT PATCH **************************************************
snakeBoss - boss with a tail that grows longer after damage or eating power ups
maybe have it eat blocks too?
replaced tech, field, and gun text with orbs
orbs length scale with px->em
cleaned up simulation variables text in pause menu
some minor tech description changes
total tech count no longer includes instant tech or removed tech
trying out putting actual system error messages directly into the in-game console
tech: planned obsolescence - at the start of each level eject your oldest tech and gain 1.1 damage
charmed baryons: 0.66->0.8x movement
grappling hook field: 0.6->0.5 damage taken
heuristics 1.3 -> between 1 and 1.5 fire rate
combinatorial optimization 1.35->1.4 damage
******************************************************* DESIGN ******************************************************
difficulty reduction per level
0.85->0.87x damage done
1.23->1.22 damage taken
priorities
synergies between tech
difficult to achieve synergies that feel so powerful they are game breaking / changing
randomized content that adds repeatability
bosses, mobs, levels, tech
graphical indicators of tech effects and quantity
subtle lore woven into unexpected places
******************************************************** BUGS ********************************************************
add more randomize sub level map content
left/right sides of lock
small lab rooms
ants marching outline on splash screen doesn't sync right on safari
list of powerful synergies
CPT + high energy regen
research + bot fabrication + ersatz bots + various bot upgrades
harpoon + high fire rate + alternator + time dilation
duplication 100%
interest + coupling, research + (peer review? or Bayesian statistics)
electronegativity and high energy?
electronegativity + anyon + duplication + Maxwells demon + interest + pair production
chain reaction + invulnerable + Abelian group + parasitism = clear all mobs on level
player can become crouched while not touching the ground if they exit the ground while crouched
fix door.isClosing actually meaning isClosed?
*********************************************************** TODO *****************************************************
tech - at the start of each new level eject the oldest tech you have and gain 10% damage
merge multiple power ups of the same type if nearby
5-10 ammo, research, coupling can merge to form a slightly larger power up version
check for merger possibility every 60 seconds?
adjust mass spawns to just spawn larger power ups versions and change?
spawnDelay
white laser
what to name? not much in wikipedia
goes through shields?
damage, energy cost
3+ closely overlapping beams (but reflecting, not like diffusion)
tech.laserColor = "#fff"
tech.laserColorAlpha = "rgba(255, 255, 255, 0.5)"
tech: atomic pile - lose 1 health if you are above the maximum energy
generate energy for each nearby mob?
do damage?
@@ -56,9 +43,6 @@ tech: atomic pile - lose 1 health if you are above the maximum energy
field tech: molecular assembler - every time you spawn a drone/spore/... become immune to damage for time
scales with how much energy was used to spawn drone/...
make some explosions have less knock back?
annoying with flame test, boom bot?
figure out how to put instructions for controls in background on initial level
mouse smooth makes the text position jitter when it moves sub pixels
hide the jitter with artificial jitter to make it seem intentional
@@ -154,8 +138,6 @@ make sure healing isn't effected by simulation.healScale
instead heal orb size should be scaled
but the ratio between size and heal shouldn't be effected
tech - destroys a random tech each new level and gains +damage each time
boss - tracks the position, velocity, angle of power ups, blocks, and bullets it fires
reactor only?
will rewind time
@@ -992,77 +974,6 @@ n-gon outreach ideas
hacker news - show hacker news post
twitch - lets play
******************************************************** BUGS ********************************************************
bug: maybe I can put in an event listener to reset inputs to false when you tab out to prevent key sticking
bug - url sharing still broken sometimes
tech upgrade to anthropic principle to make it trigger at 50% life and 0% once per map
bug? cloaking field doesn't show energy over max
run more profiles of n-gon to fix performance issues
bug - death while paused crashes game?
bug: possibly clearing away all bullets causes a problem
bullet.js 255 (.do() is missing)
I died and quantum immortality triggered (I had needles and ice-IX)
game crashed but recovered
vanish element bug, crashes on touching element, happens for 1 person maybe with junk tech?
safari issues
once: can't pick up blocks
fixed on new map
cloaking field
once: after damage, locked into slow time mode
fixed on damage
3 times player head graphics not rotating
left/right leg flip broke
walk leg direction, legs are walking backwards
happened maybe after power up selection menu??
cloaking field(at least once)
aiming still works
fixed on new map, although flip still broken (is flip a separate issue?)
flip fixed on new game
sharing builds as html doesn't work for long lists...
it shouldn't be sharing undefined at all
probably some other problems too
(this might be fixed...)
blocks on buttons teleport into the button endlessly if they are being slowly floated away
maybe add a cooldown?
can't reproduce
ants marching outline doesn't sync right on safari anymore.
door to exit in level: vats does nothing
did I do that?
death while in power up selection menu doesn't reset properly
of course it's not possible to die in this menu unless you use testing and shift+X
player can become crouched while not touching the ground if they exit the ground while crouched
a couple times people have reported the final boss dropping extra bodies on death
blue triangle boss can move backwards and aim away from you if set up properly
issues with dot product probably, but might not be worth fixing
mouse event e.which is deprecated
fix door.isClosing actually meaning isClosed?
make it so that when you are immune to harm you can either jump on mobs or you pass through them
is there a way to check if the player is stuck inside the map or block
trigger a short term non-collide if that occurs
(intermittent, but almost every time) bug - capping the fps causes random slow downs, that can be fixed with pause
******************************************************** LEVELS ********************************************************
map: observatory
@@ -1210,6 +1121,72 @@ add sounds
// tone(445.50)
// tone(495)
******************************************************** IMAGES ********************************************************
process: discord midjourney prompts -> "pixelmator pro" adjust color, repair, scale to 384x256, export PNG -> webP? -> place in /img folder
make n-gon a progressive web app to manage image downloads, cache
wave function collapse opens the pause menu after it triggers alternate reality
this is actually good, maybe reuse this code to get pause menu to open at any time
if pause is pressed while selecting power ups, display pause menu on top of selection menu
***styles***
try --- Pastel drawing, Psychedelic art, Arabesque (cool patterns), knolling (everything spread out and placed on a flat mat)
try taking screen shots of fields graphics and feeding them into midJourney V4
technology stuff --- Dan Matutina (cute complex technology),
Katsuhiro Otomo (intricate space technology), Tsutomu Nihei (black and white detailed future tech)
infographics of all know multiverses. 1980s Japanese graphic design, dimensional astrolabe,
Japanese poster graphics, Ralph McQuarrie (looks like star wars), Simon Stålenhag (retro-futuristic), Yoshiyuki Tomino (detailed anime future technology)
isometric: low-poly, box cutout, made in blender, Materials: matte clay
subtractive sculpture
kinetic sculpture
quantum stuff -- Hypertorus, Glowing Opal Pearlescent, Physics, Hydro-Dipping Hydrodipped, Vija Celmins, Matt Molloy (photo of golden waves in the sky)
***maybe redo***
laser
supercritical fission
***past style themes***
base prompt for player on 5.2: clean white robot spherical turret on bird legs test chamber
standing wave - a 3-D cyan transparent nested concentric aligned centered sphere with rings
by Philippe Starck
perfect diamagnetism - physics magnetic field chalk diagram
time dilation - graphic of a hyperbolic equation Luminogram
negative mass - Blacklight painting by Moebius
plasma torch - by Dan Mumford
metamaterial cloaking - Scientific photography by Miki Asai, by Bruce Munro
molecular assembler - by Laurie Greasley 16-bit Isometric
wormhole - by Tim White
pilot wave - none
nail gun - Screenprint
shotgun - blueprint by Dan McPharlin
grenades, missiles, explosions - vibrant fireball explosion sonic shockwave ring art by Victo Ngai --ar 3:2 --v 5 --s 750
spores - turquoise black spores on a white background full color scientific anatomy by Ernst Haeckel
drones - insect quadcopter tilt-shift photography
super balls - By Akari Toriyama
wave - sound wave oscilloscope by Paul Catherall, concentric circles by Paul Catherall
Barbara Takenaga's painting depicting a clean sound wave on aoscilloscope device --ar 3:2 --v 5
foam - black blobs Ink doodle
harpoon - iron harpoon on a rope weapon art white background by Eiichiro Oda --no fish --ar 3:2 --v 5 --s 750
mine - by Dan McPharlin
laser - complex optical scientific equipment
knolling photography
guns, ammo - isometric clean pixel art image cutaway of , style of tekkonkinkreet
defensive - Paper cutout
bots - hovering drone by Laurie Greasley 16-bit Isometric
generic energy tech - by Laurie Greasley
duplication, cancel - by Kazumasa Nagai
anti-shear topology, fracture analysis, shear stress - Chemigram
ON/OFF - ASCII art
block throwing - Bauhaus style
tech that adds JUNK - by Choi Jeong-hwa
ice IX - microscope images of ice crystals
tech that spawns health - glowing green balls by Enki Bilal
invulnerable - by Nick Veasey (photos that look like x-rays)
alternate reality - Fractal art
tech choice - mandala tile Mosaic
time, CPT, pause - by Lee Bontecou
boost, coupling power ups tech - cyan electron orbiting a black nucleus electric field as bas-relief //(by Kazumasa Nagai)
radioactive - volumetric atomic nucleus diagram by Paul Catherall
******************************************************** LORE ********************************************************
@@ -1279,75 +1256,32 @@ possible names for tech
Casimir effect - attractive force between two close conductive plates
difference engine - early calculator/computer
cyanoacrylate - superglue use for a slowing effect?
hysteresis - the dependence of the state of a system on its history
superposition - something with waves overlapping
math terms - integral, derivative, Laplace transform, inflection point
quasicrystals - something with low friction, maybe defense?
Coalescence - things merging together like clouds. maybe mergin power ups?
trihydrogen cation - common molecule in space, dark matter tech?
******************************************************** IMAGES ********************************************************
process: discord midjourney prompts -> "pixelmator pro" adjust color, repair, scale to 384x256, export PNG -> webP? -> place in /img folder
make n-gon a progressive web app to manage image downloads, cache
wave function collapse opens the pause menu after it triggers alternate reality
this is actually good, maybe reuse this code to get pause menu to open at any time
if pause is pressed while selecting power ups, display pause menu on top of selection menu
***styles***
try --- Pastel drawing, Psychedelic art, Arabesque (cool patterns), knolling (everything spread out and placed on a flat mat)
try taking screen shots of fields graphics and feeding them into midJourney V4
technology stuff --- Dan Matutina (cute complex technology),
Katsuhiro Otomo (intricate space technology), Tsutomu Nihei (black and white detailed future tech)
infographics of all know multiverses. 1980s Japanese graphic design, dimensional astrolabe,
Japanese poster graphics, Ralph McQuarrie (looks like star wars), Simon Stålenhag (retro-futuristic), Yoshiyuki Tomino (detailed anime future technology)
isometric: low-poly, box cutout, made in blender, Materials: matte clay
subtractive sculpture
kinetic sculpture
quantum stuff -- Hypertorus, Glowing Opal Pearlescent, Physics, Hydro-Dipping Hydrodipped, Vija Celmins, Matt Molloy (photo of golden waves in the sky)
***maybe redo***
laser
supercritical fission
***past style themes***
base prompt for player on 5.2: clean white robot spherical turret on bird legs test chamber
standing wave - a 3-D cyan transparent nested concentric aligned centered sphere with rings
by Philippe Starck
perfect diamagnetism - physics magnetic field chalk diagram
time dilation - graphic of a hyperbolic equation Luminogram
negative mass - Blacklight painting by Moebius
plasma torch - by Dan Mumford
metamaterial cloaking - Scientific photography by Miki Asai, by Bruce Munro
molecular assembler - by Laurie Greasley 16-bit Isometric
wormhole - by Tim White
pilot wave - none
nail gun - Screenprint
shotgun - blueprint by Dan McPharlin
grenades, missiles, explosions - vibrant fireball explosion sonic shockwave ring art by Victo Ngai --ar 3:2 --v 5 --s 750
spores - turquoise black spores on a white background full color scientific anatomy by Ernst Haeckel
drones - insect quadcopter tilt-shift photography
super balls - By Akari Toriyama
wave - sound wave oscilloscope by Paul Catherall, concentric circles by Paul Catherall
Barbara Takenaga's painting depicting a clean sound wave on aoscilloscope device --ar 3:2 --v 5
foam - black blobs Ink doodle
harpoon - iron harpoon on a rope weapon art white background by Eiichiro Oda --no fish --ar 3:2 --v 5 --s 750
mine - by Dan McPharlin
laser - complex optical scientific equipment
knolling photography
guns, ammo - isometric clean pixel art image cutaway of , style of tekkonkinkreet
defensive - Paper cutout
bots - hovering drone by Laurie Greasley 16-bit Isometric
generic energy tech - by Laurie Greasley
duplication, cancel - by Kazumasa Nagai
anti-shear topology, fracture analysis, shear stress - Chemigram
ON/OFF - ASCII art
block throwing - Bauhaus style
tech that adds JUNK - by Choi Jeong-hwa
ice IX - microscope images of ice crystals
tech that spawns health - glowing green balls by Enki Bilal
invulnerable - by Nick Veasey (photos that look like x-rays)
alternate reality - Fractal art
tech choice - mandala tile Mosaic
time, CPT, pause - by Lee Bontecou
boost, coupling power ups tech - cyan electron orbiting a black nucleus electric field as bas-relief //(by Kazumasa Nagai)
radioactive - volumetric atomic nucleus diagram by Paul Catherall
******************************************************* DESIGN ******************************************************
priorities
synergies between tech
difficult to achieve synergies that feel so powerful they are game breaking / changing
randomized content that adds repeatability
bosses, mobs, levels, tech
graphical indicators of tech effects and quantity
subtle lore woven into unexpected places
add more randomize sub level map content
left/right sides of lock
small lab rooms
list of powerful synergies
CPT + high energy regen
research + bot fabrication + ersatz bots + various bot upgrades
harpoon + high fire rate + alternator + time dilation
duplication 100%
interest + coupling, research + (peer review? or Bayesian statistics)
electronegativity and high energy?
electronegativity + anyon + duplication + Maxwells demon + interest + pair production
chain reaction + invulnerable + Abelian group + parasitism = clear all mobs on level