training maps
first 4 levels of the training maps are live this is very much a work in progress, but I'm putting it up for feedback stunned and frozen mobs do no harm by default removed tech: osmoprotectant - stunned and frozen mobs do no harm tech: annelids - randomly increase worm size and damage up to 100% weak anthropic principle gives 45->50% duplication chance after almost dieing complex spin-statistics immune to harm for 1.5->1.8 s every 7 s exciton gives 60->66% damage electronegativity gives 1% dmg for every 11->10 stored energy arsenal gives 14->12% more damage per gun pair production is now also a standing wave field tech mass-energy takes 10% less damage JUNK tech black hole cluster spawns mobs farther away, so you have a better chance to survive undefinded tech no longer shows up on your first couple times playing, since it's a distraction for new players
This commit is contained in:
@@ -93,6 +93,11 @@
|
|||||||
<text x="10" y="33">experiment</text>
|
<text x="10" y="33">experiment</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
<svg class="SVG-button" id="training-button" width="120" height="45" style="border: 2px #333 solid;" onclick="simulation.startGame(false, true)">
|
||||||
|
<g stroke='none' fill='#333' stroke-width="2" font-size="30px" font-family="Arial, sans-serif">
|
||||||
|
<text x="10" y="33">training</text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
<div id='info'>
|
<div id='info'>
|
||||||
<div id="settings">
|
<div id="settings">
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
12
js/bullet.js
12
js/bullet.js
@@ -2361,9 +2361,9 @@ const b = {
|
|||||||
},
|
},
|
||||||
worm(where, isFreeze = tech.isSporeFreeze) { //used with the tech upgrade in mob.death()
|
worm(where, isFreeze = tech.isSporeFreeze) { //used with the tech upgrade in mob.death()
|
||||||
const bIndex = bullet.length;
|
const bIndex = bullet.length;
|
||||||
const size = 3
|
const wormSize = 6 + tech.wormSize * 7.2 * Math.random()
|
||||||
if (bIndex < 500) { //can't make over 500 spores
|
if (bIndex < 500) { //can't make over 500 spores
|
||||||
bullet[bIndex] = Bodies.polygon(where.x, where.y, size, size, {
|
bullet[bIndex] = Bodies.polygon(where.x, where.y, 3, 3, {
|
||||||
inertia: Infinity,
|
inertia: Infinity,
|
||||||
isFreeze: isFreeze,
|
isFreeze: isFreeze,
|
||||||
restitution: 0.5,
|
restitution: 0.5,
|
||||||
@@ -2371,7 +2371,9 @@ const b = {
|
|||||||
friction: 0,
|
friction: 0,
|
||||||
frictionAir: 0.025,
|
frictionAir: 0.025,
|
||||||
thrust: (tech.isFastSpores ? 0.001 : 0.0005) * (1 + 0.5 * (Math.random() - 0.5)),
|
thrust: (tech.isFastSpores ? 0.001 : 0.0005) * (1 + 0.5 * (Math.random() - 0.5)),
|
||||||
dmg: (tech.isMutualism ? 16.8 : 7) * 2.5, //bonus damage from tech.isMutualism //2.5 is extra damage as worm
|
wormSize: wormSize,
|
||||||
|
wormTail: 1 + wormSize,
|
||||||
|
dmg: (tech.isMutualism ? 7 : 2.9) * wormSize, //bonus damage from tech.isMutualism //2.5 is extra damage as worm
|
||||||
lookFrequency: 100 + Math.floor(37 * Math.random()),
|
lookFrequency: 100 + Math.floor(37 * Math.random()),
|
||||||
classType: "bullet",
|
classType: "bullet",
|
||||||
collisionFilter: {
|
collisionFilter: {
|
||||||
@@ -2408,10 +2410,10 @@ const b = {
|
|||||||
do() {
|
do() {
|
||||||
ctx.beginPath(); //draw nematode
|
ctx.beginPath(); //draw nematode
|
||||||
ctx.moveTo(this.position.x, this.position.y);
|
ctx.moveTo(this.position.x, this.position.y);
|
||||||
const dir = Vector.mult(Vector.normalise(this.velocity), -Math.min(45, 7 * this.speed))
|
const dir = Vector.mult(Vector.normalise(this.velocity), -Math.min(100, this.wormTail * this.speed))
|
||||||
const tail = Vector.add(this.position, dir)
|
const tail = Vector.add(this.position, dir)
|
||||||
ctx.lineTo(tail.x, tail.y);
|
ctx.lineTo(tail.x, tail.y);
|
||||||
ctx.lineWidth = 6;
|
ctx.lineWidth = this.wormSize;
|
||||||
ctx.strokeStyle = "#000";
|
ctx.strokeStyle = "#000";
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ function collisionChecks(event) {
|
|||||||
if (
|
if (
|
||||||
m.immuneCycle < m.cycle &&
|
m.immuneCycle < m.cycle &&
|
||||||
(obj === playerBody || obj === playerHead) &&
|
(obj === playerBody || obj === playerHead) &&
|
||||||
!(tech.isFreezeHarmImmune && (mob[k].isSlowed || mob[k].isStunned))
|
!mob[k].isSlowed && !mob[k].isStunned
|
||||||
) {
|
) {
|
||||||
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * simulation.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
|
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * simulation.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
|
||||||
if (m.isCloak) dmg *= 0.5
|
if (m.isCloak) dmg *= 0.5
|
||||||
|
|||||||
12
js/index.js
12
js/index.js
@@ -622,6 +622,7 @@ ${simulation.isCheating ? "<br><br><em>lore disabled</em>": ""}
|
|||||||
|
|
||||||
function openExperimentMenu() {
|
function openExperimentMenu() {
|
||||||
document.getElementById("experiment-button").style.display = "none";
|
document.getElementById("experiment-button").style.display = "none";
|
||||||
|
document.getElementById("training-button").style.display = "none";
|
||||||
const el = document.getElementById("experiment-grid")
|
const el = document.getElementById("experiment-grid")
|
||||||
el.style.display = "grid"
|
el.style.display = "grid"
|
||||||
document.body.style.overflowY = "scroll";
|
document.body.style.overflowY = "scroll";
|
||||||
@@ -1295,16 +1296,5 @@ function cycle() {
|
|||||||
level.start();
|
level.start();
|
||||||
}
|
}
|
||||||
simulation.loop();
|
simulation.loop();
|
||||||
// if (isNaN(m.health) || isNaN(m.energy)) {
|
|
||||||
// console.log(`m.health = ${m.health}`)
|
|
||||||
// simulation.paused = true;
|
|
||||||
// build.pauseGrid()
|
|
||||||
// document.body.style.cursor = "auto";
|
|
||||||
// alert("health is NaN, please report this bug to the discord \n https://discordapp.com/invite/2eC9pgJ")
|
|
||||||
// }
|
|
||||||
// for (let i = 0, len = loop.length; i < len; i++) {
|
|
||||||
// loop[i]()
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// simulation.introPlayer()
|
|
||||||
362
js/level.js
362
js/level.js
@@ -8,6 +8,7 @@ const level = {
|
|||||||
onLevel: -1,
|
onLevel: -1,
|
||||||
levelsCleared: 0,
|
levelsCleared: 0,
|
||||||
playableLevels: ["labs", "rooftops", "skyscrapers", "warehouse", "highrise", "office", "aerie", "satellite", "sewers", "testChamber"],
|
playableLevels: ["labs", "rooftops", "skyscrapers", "warehouse", "highrise", "office", "aerie", "satellite", "sewers", "testChamber"],
|
||||||
|
trainingLevels: ["trainingHold", "trainingThrow", "trainingCrouch", "trainingJump"],
|
||||||
levels: [],
|
levels: [],
|
||||||
start() {
|
start() {
|
||||||
if (level.levelsCleared === 0) { //this code only runs on the first level
|
if (level.levelsCleared === 0) { //this code only runs on the first level
|
||||||
@@ -17,19 +18,23 @@ const level = {
|
|||||||
// level.difficultyIncrease(30) //30 is near max on hard //60 is near max on why
|
// level.difficultyIncrease(30) //30 is near max on hard //60 is near max on why
|
||||||
// simulation.isHorizontalFlipped = true
|
// simulation.isHorizontalFlipped = true
|
||||||
// m.setField("plasma torch")
|
// m.setField("plasma torch")
|
||||||
// b.giveGuns("drones")
|
// b.giveGuns("spores")
|
||||||
// b.giveGuns("nail gun")
|
// b.giveGuns("nail gun")
|
||||||
// b.giveGuns("harpoon")
|
// b.giveGuns("harpoon")
|
||||||
// tech.giveTech("brainstorming")
|
// tech.giveTech("nematodes")
|
||||||
// tech.giveTech("nanowires")
|
// for (let i = 0; i < 9; i++) tech.giveTech("annelids")
|
||||||
// tech.giveTech("relativistic momentum")
|
// tech.giveTech("tinsellated flagella")
|
||||||
// for (let i = 0; i < 2; i++) tech.giveTech("refractory metal")
|
// for (let i = 0; i < 2; i++) tech.giveTech("refractory metal")
|
||||||
// tech.giveTech("antiscience")
|
// tech.giveTech("antiscience")
|
||||||
// for (let i = 0; i < 1; i++) tech.giveTech("reticulum")
|
// for (let i = 0; i < 1; i++) tech.giveTech("reticulum")
|
||||||
// for (let i = 0; i < 2; i++) tech.giveTech("laser-bot")
|
// for (let i = 0; i < 2; i++) tech.giveTech("laser-bot")
|
||||||
// tech.tech[297].frequency = 100
|
// tech.tech[297].frequency = 100
|
||||||
|
// level.trainingThrow();
|
||||||
|
if (simulation.isTraining) {
|
||||||
|
level.trainingHold();
|
||||||
|
} else {
|
||||||
level.intro(); //starting level
|
level.intro(); //starting level
|
||||||
|
}
|
||||||
// level.testing(); //not in rotation, used for testing
|
// level.testing(); //not in rotation, used for testing
|
||||||
// level.template(); //not in rotation, blank start new map development
|
// level.template(); //not in rotation, blank start new map development
|
||||||
// level.final() //final boss level
|
// level.final() //final boss level
|
||||||
@@ -68,13 +73,13 @@ const level = {
|
|||||||
spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns
|
spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns
|
||||||
// spawn.pickList = ["focuser", "focuser"]
|
// spawn.pickList = ["focuser", "focuser"]
|
||||||
level[level.levels[level.onLevel]](); //picks the current map from the the levels array
|
level[level.levels[level.onLevel]](); //picks the current map from the the levels array
|
||||||
if (!simulation.isCheating && !build.isExperimentRun) {
|
if (!simulation.isCheating && !build.isExperimentRun && !simulation.isTraining) {
|
||||||
localSettings.runCount += level.levelsCleared //track the number of total runs locally
|
localSettings.runCount += level.levelsCleared //track the number of total runs locally
|
||||||
localSettings.levelsClearedLastGame = level.levelsCleared
|
localSettings.levelsClearedLastGame = level.levelsCleared
|
||||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
level.levelAnnounce();
|
if (!simulation.isTraining) level.levelAnnounce();
|
||||||
simulation.noCameraScroll();
|
simulation.noCameraScroll();
|
||||||
simulation.setZoom();
|
simulation.setZoom();
|
||||||
level.addToWorld(); //add bodies to game engine
|
level.addToWorld(); //add bodies to game engine
|
||||||
@@ -131,6 +136,337 @@ const level = {
|
|||||||
// for (let i = 0; i < 2; i++) powerUps.spawn(player.position.x + 90 * (Math.random() - 0.5), player.position.y + 90 * (Math.random() - 0.5), "tech", false); //start
|
// for (let i = 0; i < 2; i++) powerUps.spawn(player.position.x + 90 * (Math.random() - 0.5), player.position.y + 90 * (Math.random() - 0.5), "tech", false); //start
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
trainingJump() { //learn to crouch
|
||||||
|
m.addHealth(Infinity)
|
||||||
|
document.getElementById("health").style.display = "none" //hide your health bar
|
||||||
|
document.getElementById("health-bg").style.display = "none"
|
||||||
|
|
||||||
|
level.setPosToSpawn(60, -50); //normal spawn
|
||||||
|
spawn.mapRect(10, -10, 100, 20); //small platform for player
|
||||||
|
level.exit.x = 1775;
|
||||||
|
level.exit.y = -35;
|
||||||
|
spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 100); //exit bump
|
||||||
|
simulation.zoomScale = 1400 //1400 is normal
|
||||||
|
level.defaultZoom = 1400
|
||||||
|
simulation.zoomTransition(level.defaultZoom, 1)
|
||||||
|
document.body.style.backgroundColor = "#e1e1e1";
|
||||||
|
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
let instruction = 0
|
||||||
|
simulation.makeTextLog(`hold down <strong>${input.key.up}</strong> longer to jump higher`, Infinity)
|
||||||
|
|
||||||
|
level.custom = () => {
|
||||||
|
if (instruction === 0 && m.pos.x > 300) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>hold down <strong>${input.key.up}</strong> longer to jump higher</s>`, Infinity)
|
||||||
|
}
|
||||||
|
|
||||||
|
m.health = 1 //can't die
|
||||||
|
//exit room
|
||||||
|
ctx.fillStyle = "#f2f2f2"
|
||||||
|
ctx.fillRect(1600, -400, 400, 400)
|
||||||
|
level.exit.draw();
|
||||||
|
level.enter.draw();
|
||||||
|
level.playerExitCheck();
|
||||||
|
};
|
||||||
|
level.customTopLayer = () => {
|
||||||
|
//dark
|
||||||
|
ctx.fillStyle = "rgba(0,0,0,0.2)"
|
||||||
|
ctx.fillRect(1000, 0, 450, 1800)
|
||||||
|
//exit room glow
|
||||||
|
ctx.fillStyle = "rgba(0,255,255,0.05)"
|
||||||
|
ctx.fillRect(1600, -400, 400, 400)
|
||||||
|
};
|
||||||
|
|
||||||
|
spawn.mapRect(-2750, -2800, 2600, 4600); //left wall
|
||||||
|
spawn.mapRect(2000, -2800, 2600, 4600); //right wall
|
||||||
|
spawn.mapRect(275, -350, 200, 375);
|
||||||
|
spawn.mapRect(-250, 0, 1250, 1800);
|
||||||
|
spawn.mapRect(1450, 0, 1075, 1800);
|
||||||
|
spawn.mapRect(-250, -2800, 3500, 2200); //roof
|
||||||
|
|
||||||
|
spawn.mapRect(1600, -1200, 500, 850); //exit roof
|
||||||
|
spawn.mapRect(1600, -400, 50, 225); //exit room left upper wall
|
||||||
|
},
|
||||||
|
trainingCrouch() { //learn to crouch
|
||||||
|
m.addHealth(Infinity)
|
||||||
|
//hide your health bar
|
||||||
|
document.getElementById("health").style.display = "none"
|
||||||
|
document.getElementById("health-bg").style.display = "none"
|
||||||
|
|
||||||
|
level.setPosToSpawn(60, -50); //normal spawn
|
||||||
|
spawn.mapRect(10, -10, 100, 20); //small platform for player
|
||||||
|
level.exit.x = 1775;
|
||||||
|
level.exit.y = -35;
|
||||||
|
spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 100); //exit bump
|
||||||
|
simulation.zoomScale = 1400 //1400 is normal
|
||||||
|
level.defaultZoom = 1400
|
||||||
|
simulation.zoomTransition(level.defaultZoom, 1)
|
||||||
|
document.body.style.backgroundColor = "#e1e1e1";
|
||||||
|
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
let instruction = 0
|
||||||
|
simulation.makeTextLog(`press <strong>${input.key.down}</strong> to crouch`, Infinity)
|
||||||
|
|
||||||
|
level.custom = () => {
|
||||||
|
if (instruction === 0 && input.down) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>press <strong>${input.key.down}</strong> to crouch</s>`, Infinity)
|
||||||
|
}
|
||||||
|
//exit room
|
||||||
|
ctx.fillStyle = "#f2f2f2"
|
||||||
|
ctx.fillRect(1650, -400, 400, 400)
|
||||||
|
level.exit.draw();
|
||||||
|
level.enter.draw();
|
||||||
|
level.playerExitCheck();
|
||||||
|
};
|
||||||
|
level.customTopLayer = () => {
|
||||||
|
//exit room glow
|
||||||
|
ctx.fillStyle = "rgba(0,255,255,0.05)"
|
||||||
|
ctx.fillRect(1650, -400, 400, 400)
|
||||||
|
//dark
|
||||||
|
ctx.fillStyle = "rgba(0,0,0,0.2)"
|
||||||
|
ctx.fillRect(625, -100, 1025, 175)
|
||||||
|
};
|
||||||
|
|
||||||
|
// spawn.mapRect(1025, -675, 300, 623); //crouch wall
|
||||||
|
spawn.mapRect(625, -650, 1025, 550);
|
||||||
|
spawn.mapRect(-200, -650, 875, 300);
|
||||||
|
|
||||||
|
spawn.mapRect(-2750, -2800, 2600, 4600); //left wall
|
||||||
|
spawn.mapRect(2000, -2800, 2600, 4600); //right wall
|
||||||
|
spawn.mapRect(-250, 50, 3500, 1750); //floor
|
||||||
|
spawn.mapRect(-200, 0, 950, 100);
|
||||||
|
spawn.mapRect(1575, 0, 500, 100);
|
||||||
|
spawn.mapRect(-250, -2800, 3500, 2200); //roof
|
||||||
|
|
||||||
|
spawn.mapRect(725, 12, 50, 25);
|
||||||
|
spawn.mapRect(725, 25, 75, 25);
|
||||||
|
spawn.mapRect(750, 38, 75, 25);
|
||||||
|
spawn.mapRect(1525, 25, 75, 50);
|
||||||
|
spawn.mapRect(1500, 38, 50, 25);
|
||||||
|
spawn.mapRect(1550, 12, 50, 25);
|
||||||
|
spawn.mapRect(1600, -1200, 500, 850); //exit roof
|
||||||
|
spawn.mapRect(1600, -400, 50, 225); //exit room left upper wall
|
||||||
|
},
|
||||||
|
trainingThrow() { //throw a block on button to open door
|
||||||
|
m.addHealth(Infinity)
|
||||||
|
//hide your health bar
|
||||||
|
document.getElementById("health").style.display = "none"
|
||||||
|
document.getElementById("health-bg").style.display = "none"
|
||||||
|
|
||||||
|
level.setPosToSpawn(60, -50); //normal spawn
|
||||||
|
spawn.mapRect(10, -10, 100, 20); //small platform for player
|
||||||
|
level.exit.x = 1775;
|
||||||
|
level.exit.y = -35;
|
||||||
|
spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 100); //exit bump
|
||||||
|
simulation.zoomScale = 1400 //1400 is normal
|
||||||
|
level.defaultZoom = 1400
|
||||||
|
simulation.zoomTransition(level.defaultZoom, 1)
|
||||||
|
document.body.style.backgroundColor = "#e1e1e1";
|
||||||
|
|
||||||
|
spawn.bodyRect(1025, -75, 50, 50); //block to go on button
|
||||||
|
const buttonDoor = level.button(1635, -400)
|
||||||
|
const door = level.door(1612.5, -175, 25, 190, 185, 3)
|
||||||
|
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
let instruction = 0
|
||||||
|
simulation.makeTextLog(`activate your <strong class='color-f'>field</strong> with <strong>space</strong> or <strong>right mouse</strong>
|
||||||
|
<br>pick up the <strong class='color-block'>block</strong> with your <strong class='color-f'>field</strong>`, Infinity)
|
||||||
|
|
||||||
|
level.custom = () => {
|
||||||
|
console.log(m.throwCharge)
|
||||||
|
if (instruction === 0 && m.isHolding) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>pick up the <strong class='color-block'>block</strong> with your <strong class='color-f'>field</strong></s>
|
||||||
|
<br>hold your <strong class='color-f'>field</strong> down to charge up then release to throw a <strong class='color-block'>block</strong>`, Infinity)
|
||||||
|
} else if (instruction === 1 && m.throwCharge > 2) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>pick up the <strong class='color-block'>block</strong> with your <strong class='color-f'>field</strong>
|
||||||
|
<br>hold your <strong class='color-f'>field</strong> down to charge up then release to throw a <strong class='color-block'>block</strong></s>
|
||||||
|
<br>throw the <strong class='color-block'>block</strong> onto the button`, Infinity)
|
||||||
|
// the <strong class='color-block'>block</strong> at the button
|
||||||
|
} else if (instruction === 2 && !buttonDoor.isUp && Vector.magnitudeSquared(Vector.sub(body[0].position, buttonDoor.min)) < 10000) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>pick up the <strong class='color-block'>block</strong> with your <strong class='color-f'>field</strong>
|
||||||
|
<br>hold your <strong class='color-f'>field</strong> down to charge up then release to throw a <strong class='color-block'>block</strong>
|
||||||
|
<br>throw the <strong class='color-block'>block</strong> onto the button</s>`, Infinity)
|
||||||
|
}
|
||||||
|
//exit room
|
||||||
|
ctx.fillStyle = "#f2f2f2"
|
||||||
|
ctx.fillRect(1600, -400, 400, 400)
|
||||||
|
level.exit.draw();
|
||||||
|
level.enter.draw();
|
||||||
|
level.playerExitCheck();
|
||||||
|
};
|
||||||
|
level.customTopLayer = () => {
|
||||||
|
buttonDoor.query();
|
||||||
|
buttonDoor.draw();
|
||||||
|
if (buttonDoor.isUp) {
|
||||||
|
door.isOpen = true
|
||||||
|
} else {
|
||||||
|
door.isOpen = false
|
||||||
|
}
|
||||||
|
door.openClose();
|
||||||
|
door.draw();
|
||||||
|
//exit room glow
|
||||||
|
ctx.fillStyle = "rgba(0,255,255,0.05)"
|
||||||
|
ctx.fillRect(1600, -400, 400, 400)
|
||||||
|
};
|
||||||
|
|
||||||
|
spawn.mapRect(-2750, -2800, 2600, 4600); //left wall
|
||||||
|
spawn.mapRect(2000, -2800, 2600, 4600); //right wall
|
||||||
|
spawn.mapRect(-250, 50, 3500, 1750); //floor
|
||||||
|
spawn.mapRect(-200, 0, 950, 100);
|
||||||
|
spawn.mapRect(1575, 0, 500, 100);
|
||||||
|
spawn.mapRect(-250, -2800, 3500, 2200); //roof
|
||||||
|
|
||||||
|
spawn.mapRect(725, 12, 50, 25);
|
||||||
|
spawn.mapRect(725, 25, 75, 25);
|
||||||
|
spawn.mapRect(750, 38, 75, 25);
|
||||||
|
spawn.mapRect(1525, 25, 75, 50);
|
||||||
|
spawn.mapRect(1500, 38, 50, 25);
|
||||||
|
spawn.mapRect(1550, 12, 50, 25);
|
||||||
|
// spawn.mapRect(1600, -1200, 500, 850); //exit roof
|
||||||
|
spawn.mapRect(1790, -600, 250, 225); //button left wall
|
||||||
|
spawn.mapRect(1625, -400, 400, 50);
|
||||||
|
spawn.mapRect(1600, -400, 50, 225); //exit room left upper wall
|
||||||
|
},
|
||||||
|
trainingHold() { //put block on button to open door
|
||||||
|
m.addHealth(Infinity)
|
||||||
|
//hide your health bar
|
||||||
|
document.getElementById("health").style.display = "none"
|
||||||
|
document.getElementById("health-bg").style.display = "none"
|
||||||
|
|
||||||
|
level.setPosToSpawn(60, -50); //normal spawn
|
||||||
|
spawn.mapRect(10, -10, 100, 20); //small platform for player
|
||||||
|
level.exit.x = 1775;
|
||||||
|
level.exit.y = -35;
|
||||||
|
spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 100); //exit bump
|
||||||
|
simulation.zoomScale = 1400 //1400 is normal
|
||||||
|
level.defaultZoom = 1400
|
||||||
|
simulation.zoomTransition(level.defaultZoom, 1)
|
||||||
|
document.body.style.backgroundColor = "#e1e1e1";
|
||||||
|
|
||||||
|
spawn.bodyRect(1025, -75, 50, 50); //block to go on button
|
||||||
|
const buttonDoor = level.button(500, 0)
|
||||||
|
const door = level.door(1612.5, -175, 25, 190, 185, 3)
|
||||||
|
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
let instruction = 0
|
||||||
|
simulation.makeTextLog(`activate your <strong class='color-f'>field</strong> with <strong>space</strong> or <strong>right mouse</strong>`, Infinity)
|
||||||
|
|
||||||
|
level.custom = () => {
|
||||||
|
if (instruction === 0 && input.field) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>activate your <strong class='color-f'>field</strong> with <strong>space</strong> or <strong>right mouse</strong></s><br>release your <strong class='color-f'>field</strong> on a <strong class='color-block'>block</strong> to pick it up`, Infinity)
|
||||||
|
} else if (instruction === 1 && m.isHolding) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>activate your <strong class='color-f'>field</strong> with <strong>space</strong> or <strong>right mouse</strong><br>release your <strong class='color-f'>field</strong> on a <strong class='color-block'>block</strong> to pick it up</s><br>drop the <strong class='color-block'>block</strong> on the red button to open the door`, Infinity)
|
||||||
|
} else if (instruction === 2 && !buttonDoor.isUp && Vector.magnitudeSquared(Vector.sub(body[0].position, buttonDoor.min)) < 10000) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>activate your <strong class='color-f'>field</strong> with <strong>space</strong> or <strong>right mouse</strong><br>release your <strong class='color-f'>field</strong> on a <strong class='color-block'>block</strong> to pick it up<br>drop the <strong class='color-block'>block</strong> on the red button to open the door</s>`, Infinity)
|
||||||
|
}
|
||||||
|
//exit room
|
||||||
|
ctx.fillStyle = "#f2f2f2"
|
||||||
|
ctx.fillRect(1600, -400, 400, 400)
|
||||||
|
level.exit.draw();
|
||||||
|
level.enter.draw();
|
||||||
|
level.playerExitCheck();
|
||||||
|
};
|
||||||
|
level.customTopLayer = () => {
|
||||||
|
buttonDoor.query();
|
||||||
|
buttonDoor.draw();
|
||||||
|
if (buttonDoor.isUp) {
|
||||||
|
door.isOpen = true
|
||||||
|
} else {
|
||||||
|
door.isOpen = false
|
||||||
|
}
|
||||||
|
door.openClose();
|
||||||
|
door.draw();
|
||||||
|
//exit room glow
|
||||||
|
ctx.fillStyle = "rgba(0,255,255,0.05)"
|
||||||
|
ctx.fillRect(1600, -400, 400, 400)
|
||||||
|
};
|
||||||
|
|
||||||
|
spawn.mapRect(-2750, -2800, 2600, 4600); //left wall
|
||||||
|
spawn.mapRect(2000, -2800, 2600, 4600); //right wall
|
||||||
|
spawn.mapRect(-250, 50, 3500, 1750); //floor
|
||||||
|
spawn.mapRect(-200, 0, 950, 100);
|
||||||
|
spawn.mapRect(1575, 0, 500, 100);
|
||||||
|
spawn.mapRect(-250, -2800, 3500, 2200); //roof
|
||||||
|
|
||||||
|
spawn.mapRect(725, 12, 50, 25);
|
||||||
|
spawn.mapRect(725, 25, 75, 25);
|
||||||
|
spawn.mapRect(750, 38, 75, 25);
|
||||||
|
spawn.mapRect(1525, 25, 75, 50);
|
||||||
|
spawn.mapRect(1500, 38, 50, 25);
|
||||||
|
spawn.mapRect(1550, 12, 50, 25);
|
||||||
|
spawn.mapRect(1600, -1200, 500, 850); //exit roof
|
||||||
|
spawn.mapRect(1600, -400, 50, 225); //exit room left upper wall
|
||||||
|
},
|
||||||
|
trainingTemplate() { //learn to crouch
|
||||||
|
m.addHealth(Infinity)
|
||||||
|
document.getElementById("health").style.display = "none" //hide your health bar
|
||||||
|
document.getElementById("health-bg").style.display = "none"
|
||||||
|
|
||||||
|
level.setPosToSpawn(60, -50); //normal spawn
|
||||||
|
spawn.mapRect(10, -10, 100, 20); //small platform for player
|
||||||
|
level.exit.x = 1775;
|
||||||
|
level.exit.y = -35;
|
||||||
|
spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 100); //exit bump
|
||||||
|
simulation.zoomScale = 1400 //1400 is normal
|
||||||
|
level.defaultZoom = 1400
|
||||||
|
simulation.zoomTransition(level.defaultZoom, 1)
|
||||||
|
document.body.style.backgroundColor = "#e1e1e1";
|
||||||
|
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
let instruction = 0
|
||||||
|
simulation.makeTextLog(`press <strong>${input.key.down}</strong> to crouch`, Infinity)
|
||||||
|
|
||||||
|
level.custom = () => {
|
||||||
|
if (instruction === 0 && input.down) {
|
||||||
|
instruction++
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
|
simulation.makeTextLog(`<s>press <strong>${input.key.down}</strong> to crouch</s>`, Infinity)
|
||||||
|
}
|
||||||
|
//exit room
|
||||||
|
ctx.fillStyle = "#f2f2f2"
|
||||||
|
ctx.fillRect(1600, -400, 400, 400)
|
||||||
|
level.exit.draw();
|
||||||
|
level.enter.draw();
|
||||||
|
level.playerExitCheck();
|
||||||
|
};
|
||||||
|
level.customTopLayer = () => {
|
||||||
|
//exit room glow
|
||||||
|
ctx.fillStyle = "rgba(0,255,255,0.05)"
|
||||||
|
ctx.fillRect(1600, -400, 400, 400)
|
||||||
|
};
|
||||||
|
|
||||||
|
spawn.mapRect(-2750, -2800, 2600, 4600); //left wall
|
||||||
|
spawn.mapRect(2000, -2800, 2600, 4600); //right wall
|
||||||
|
spawn.mapRect(-250, 50, 3500, 1750); //floor
|
||||||
|
spawn.mapRect(-200, 0, 950, 100);
|
||||||
|
spawn.mapRect(1575, 0, 500, 100);
|
||||||
|
spawn.mapRect(-250, -2800, 3500, 2200); //roof
|
||||||
|
|
||||||
|
spawn.mapRect(725, 12, 50, 25);
|
||||||
|
spawn.mapRect(725, 25, 75, 25);
|
||||||
|
spawn.mapRect(750, 38, 75, 25);
|
||||||
|
spawn.mapRect(1525, 25, 75, 50);
|
||||||
|
spawn.mapRect(1500, 38, 50, 25);
|
||||||
|
spawn.mapRect(1550, 12, 50, 25);
|
||||||
|
spawn.mapRect(1600, -1200, 500, 850); //exit roof
|
||||||
|
spawn.mapRect(1600, -400, 50, 225); //exit room left upper wall
|
||||||
|
},
|
||||||
custom() {},
|
custom() {},
|
||||||
customTopLayer() {},
|
customTopLayer() {},
|
||||||
setDifficulty() {
|
setDifficulty() {
|
||||||
@@ -214,6 +550,9 @@ const level = {
|
|||||||
simulation.clearNow = true; //triggers in simulation.clearMap to remove all physics bodies and setup for new map
|
simulation.clearNow = true; //triggers in simulation.clearMap to remove all physics bodies and setup for new map
|
||||||
},
|
},
|
||||||
populateLevels() {
|
populateLevels() {
|
||||||
|
if (simulation.isTraining) {
|
||||||
|
level.levels = level.trainingLevels.slice(0) //copy array, not by just by assignment
|
||||||
|
} else {
|
||||||
simulation.isHorizontalFlipped = (Math.random() < 0.5) ? true : false //if true, some maps are flipped horizontally
|
simulation.isHorizontalFlipped = (Math.random() < 0.5) ? true : false //if true, some maps are flipped horizontally
|
||||||
level.levels = level.playableLevels.slice(0) //copy array, not by just by assignment
|
level.levels = level.playableLevels.slice(0) //copy array, not by just by assignment
|
||||||
if (simulation.isCommunityMaps) {
|
if (simulation.isCommunityMaps) {
|
||||||
@@ -236,6 +575,7 @@ const level = {
|
|||||||
level.levels.push("gauntlet"); //add level to the end of the randomized levels list
|
level.levels.push("gauntlet"); //add level to the end of the randomized levels list
|
||||||
level.levels.push("final"); //add level to the end of the randomized levels list
|
level.levels.push("final"); //add level to the end of the randomized levels list
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
flipHorizontal() {
|
flipHorizontal() {
|
||||||
const flipX = (who) => {
|
const flipX = (who) => {
|
||||||
@@ -723,7 +1063,7 @@ const level = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
door(x, y, width, height, distance) {
|
door(x, y, width, height, distance, speed = 1) {
|
||||||
x = x + width / 2
|
x = x + width / 2
|
||||||
y = y + height / 2
|
y = y + height / 2
|
||||||
const doorBlock = body[body.length] = Bodies.rectangle(x, y, width, height, {
|
const doorBlock = body[body.length] = Bodies.rectangle(x, y, width, height, {
|
||||||
@@ -743,7 +1083,7 @@ const level = {
|
|||||||
if (this.position.y > y - distance) { //try to open
|
if (this.position.y > y - distance) { //try to open
|
||||||
const position = {
|
const position = {
|
||||||
x: this.position.x,
|
x: this.position.x,
|
||||||
y: this.position.y - 1
|
y: this.position.y - speed
|
||||||
}
|
}
|
||||||
Matter.Body.setPosition(this, position)
|
Matter.Body.setPosition(this, position)
|
||||||
}
|
}
|
||||||
@@ -756,7 +1096,7 @@ const level = {
|
|||||||
) {
|
) {
|
||||||
const position = {
|
const position = {
|
||||||
x: this.position.x,
|
x: this.position.x,
|
||||||
y: this.position.y + 1
|
y: this.position.y + speed
|
||||||
}
|
}
|
||||||
Matter.Body.setPosition(this, position)
|
Matter.Body.setPosition(this, position)
|
||||||
}
|
}
|
||||||
@@ -1228,7 +1568,7 @@ const level = {
|
|||||||
spawn.randomMob(x + 1175, y - 725, mobSpawnChance);
|
spawn.randomMob(x + 1175, y - 725, mobSpawnChance);
|
||||||
spawn.randomMob(x + 1450, y - 725, mobSpawnChance);
|
spawn.randomMob(x + 1450, y - 725, mobSpawnChance);
|
||||||
spawn.randomMob(x + 425, y - 100, mobSpawnChance);
|
spawn.randomMob(x + 425, y - 100, mobSpawnChance);
|
||||||
spawn.randomMob(x + 1200, y - 125, mobSpawnChance);
|
spawn.randomMob(x + 1700, y - 300, mobSpawnChance);
|
||||||
spawn.randomMob(x + 1300, y - 375, mobSpawnChance);
|
spawn.randomMob(x + 1300, y - 375, mobSpawnChance);
|
||||||
}
|
}
|
||||||
ctx.fillStyle = "#d4f4f4"
|
ctx.fillStyle = "#d4f4f4"
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const lore = {
|
|||||||
if (localSettings.loreCount < 1) localSettings.loreCount = 1
|
if (localSettings.loreCount < 1) localSettings.loreCount = 1
|
||||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||||
document.getElementById("control-testing").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
|
document.getElementById("control-testing").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
|
||||||
document.getElementById("experiment-button").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
|
// document.getElementById("experiment-button").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
|
||||||
simulation.makeTextLog(`<span class='color-var'>lore</span>.unlockTesting()`, Infinity);
|
simulation.makeTextLog(`<span class='color-var'>lore</span>.unlockTesting()`, Infinity);
|
||||||
|
|
||||||
sound.portamento(50)
|
sound.portamento(50)
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ const m = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tech.isEnergyHealth) {
|
if (tech.isEnergyHealth) {
|
||||||
m.energy -= dmg * 1.1;
|
m.energy -= dmg
|
||||||
if (m.energy < 0 || isNaN(m.energy)) { //taking deadly damage
|
if (m.energy < 0 || isNaN(m.energy)) { //taking deadly damage
|
||||||
if (tech.isDeathAvoid && powerUps.research.count && !tech.isDeathAvoidedThisLevel) {
|
if (tech.isDeathAvoid && powerUps.research.count && !tech.isDeathAvoidedThisLevel) {
|
||||||
tech.isDeathAvoidedThisLevel = true
|
tech.isDeathAvoidedThisLevel = true
|
||||||
@@ -1248,7 +1248,6 @@ const m = {
|
|||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.arc(m.pos.x, m.pos.y, range, m.angle - Math.PI * m.fieldArc, m.angle + Math.PI * m.fieldArc, false);
|
ctx.arc(m.pos.x, m.pos.y, range, m.angle - Math.PI * m.fieldArc, m.angle + Math.PI * m.fieldArc, false);
|
||||||
ctx.lineWidth = 2;
|
ctx.lineWidth = 2;
|
||||||
ctx.lineCap = "butt"
|
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
let eye = 13;
|
let eye = 13;
|
||||||
let aMag = 0.75 * Math.PI * m.fieldArc
|
let aMag = 0.75 * Math.PI * m.fieldArc
|
||||||
@@ -1741,7 +1740,6 @@ const m = {
|
|||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.arc(m.pos.x, m.pos.y, m.fieldRange, m.angle - Math.PI * m.fieldArc, m.angle + Math.PI * m.fieldArc, false);
|
ctx.arc(m.pos.x, m.pos.y, m.fieldRange, m.angle - Math.PI * m.fieldArc, m.angle + Math.PI * m.fieldArc, false);
|
||||||
ctx.lineWidth = 2.5 - 1.5 * wave;
|
ctx.lineWidth = 2.5 - 1.5 * wave;
|
||||||
ctx.lineCap = "butt"
|
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
const curve = 0.57 + 0.04 * wave
|
const curve = 0.57 + 0.04 * wave
|
||||||
const aMag = (1 - curve * 1.2) * Math.PI * m.fieldArc
|
const aMag = (1 - curve * 1.2) * Math.PI * m.fieldArc
|
||||||
@@ -1766,7 +1764,6 @@ const m = {
|
|||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.arc(m.fieldPosition.x, m.fieldPosition.y, m.fieldRange, m.fieldAngle - Math.PI * m.fieldArc, m.fieldAngle + Math.PI * m.fieldArc, false);
|
ctx.arc(m.fieldPosition.x, m.fieldPosition.y, m.fieldRange, m.fieldAngle - Math.PI * m.fieldArc, m.fieldAngle + Math.PI * m.fieldArc, false);
|
||||||
ctx.lineWidth = 2.5 - 1.5 * wave;
|
ctx.lineWidth = 2.5 - 1.5 * wave;
|
||||||
ctx.lineCap = "butt"
|
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
const curve = 0.8 + 0.06 * wave
|
const curve = 0.8 + 0.06 * wave
|
||||||
const aMag = (1 - curve * 1.2) * Math.PI * m.fieldArc
|
const aMag = (1 - curve * 1.2) * Math.PI * m.fieldArc
|
||||||
@@ -3564,7 +3561,7 @@ const m = {
|
|||||||
m.immuneCycle < m.cycle &&
|
m.immuneCycle < m.cycle &&
|
||||||
// (obj === playerBody || obj === playerHead) &&
|
// (obj === playerBody || obj === playerHead) &&
|
||||||
(obj === player) &&
|
(obj === player) &&
|
||||||
!(tech.isFreezeHarmImmune && (mob[k].isSlowed || mob[k].isStunned))
|
!mob[k].isSlowed && !mob[k].isStunned
|
||||||
) {
|
) {
|
||||||
mob[k].foundPlayer();
|
mob[k].foundPlayer();
|
||||||
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * simulation.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
|
let dmg = Math.min(Math.max(0.025 * Math.sqrt(mob[k].mass), 0.05), 0.3) * simulation.dmgScale; //player damage is capped at 0.3*dmgScale of 1.0
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ const simulation = {
|
|||||||
g: 0.0024, // applies to player, bodies, and power ups (not mobs)
|
g: 0.0024, // applies to player, bodies, and power ups (not mobs)
|
||||||
onTitlePage: true,
|
onTitlePage: true,
|
||||||
isCheating: false,
|
isCheating: false,
|
||||||
|
isTraining: false,
|
||||||
paused: false,
|
paused: false,
|
||||||
isChoosing: false,
|
isChoosing: false,
|
||||||
testing: false, //testing mode: shows wire frame and some variables
|
testing: false, //testing mode: shows wire frame and some variables
|
||||||
@@ -530,6 +531,8 @@ const simulation = {
|
|||||||
document.getElementById("info").style.opacity = "0";
|
document.getElementById("info").style.opacity = "0";
|
||||||
document.getElementById("experiment-button").style.display = "inline"
|
document.getElementById("experiment-button").style.display = "inline"
|
||||||
document.getElementById("experiment-button").style.opacity = "0";
|
document.getElementById("experiment-button").style.opacity = "0";
|
||||||
|
document.getElementById("training-button").style.display = "inline"
|
||||||
|
document.getElementById("training-button").style.opacity = "0";
|
||||||
document.getElementById("experiment-grid").style.display = "none"
|
document.getElementById("experiment-grid").style.display = "none"
|
||||||
document.getElementById("pause-grid-left").style.display = "none"
|
document.getElementById("pause-grid-left").style.display = "none"
|
||||||
document.getElementById("pause-grid-right").style.display = "none"
|
document.getElementById("pause-grid-right").style.display = "none"
|
||||||
@@ -540,6 +543,7 @@ const simulation = {
|
|||||||
document.body.style.cursor = "auto";
|
document.body.style.cursor = "auto";
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.getElementById("experiment-button").style.opacity = "1";
|
document.getElementById("experiment-button").style.opacity = "1";
|
||||||
|
document.getElementById("training-button").style.opacity = "1";
|
||||||
document.getElementById("info").style.opacity = "1";
|
document.getElementById("info").style.opacity = "1";
|
||||||
document.getElementById("splash").style.opacity = "1";
|
document.getElementById("splash").style.opacity = "1";
|
||||||
}, 200);
|
}, 200);
|
||||||
@@ -588,7 +592,7 @@ const simulation = {
|
|||||||
requestAnimationFrame(cycle)
|
requestAnimationFrame(cycle)
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
startGame(isBuildRun = false) {
|
startGame(isBuildRun = false, isTrainingRun = false) {
|
||||||
simulation.clearMap()
|
simulation.clearMap()
|
||||||
if (!isBuildRun) { //if a build run logic flow returns to "experiment-button").addEventListener
|
if (!isBuildRun) { //if a build run logic flow returns to "experiment-button").addEventListener
|
||||||
document.body.style.cursor = "none";
|
document.body.style.cursor = "none";
|
||||||
@@ -601,6 +605,7 @@ const simulation = {
|
|||||||
document.getElementById("experiment-grid").style.display = "none"
|
document.getElementById("experiment-grid").style.display = "none"
|
||||||
document.getElementById("info").style.display = "none";
|
document.getElementById("info").style.display = "none";
|
||||||
document.getElementById("experiment-button").style.display = "none";
|
document.getElementById("experiment-button").style.display = "none";
|
||||||
|
document.getElementById("training-button").style.display = "none";
|
||||||
// document.getElementById("experiment-button").style.opacity = "0";
|
// document.getElementById("experiment-button").style.opacity = "0";
|
||||||
document.getElementById("splash").onclick = null; //removes the onclick effect so the function only runs once
|
document.getElementById("splash").onclick = null; //removes the onclick effect so the function only runs once
|
||||||
document.getElementById("splash").style.display = "none"; //hides the element that spawned the function
|
document.getElementById("splash").style.display = "none"; //hides the element that spawned the function
|
||||||
@@ -616,7 +621,7 @@ const simulation = {
|
|||||||
} else {
|
} else {
|
||||||
Composite.add(engine.world, [player])
|
Composite.add(engine.world, [player])
|
||||||
}
|
}
|
||||||
|
if (isTrainingRun) simulation.isTraining = true
|
||||||
level.populateLevels()
|
level.populateLevels()
|
||||||
|
|
||||||
input.endKeySensing();
|
input.endKeySensing();
|
||||||
@@ -694,6 +699,7 @@ const simulation = {
|
|||||||
tech.healMaxEnergyBonus = 0
|
tech.healMaxEnergyBonus = 0
|
||||||
m.setMaxEnergy();
|
m.setMaxEnergy();
|
||||||
m.energy = 0
|
m.energy = 0
|
||||||
|
m.immuneCycle = 0;
|
||||||
// simulation.makeTextLog(`${simulation.SVGrightMouse}<strong style='font-size:30px;'> ${m.fieldUpgrades[m.fieldMode].name}</strong><br><span class='faded'></span><br>${m.fieldUpgrades[m.fieldMode].description}`, 600);
|
// simulation.makeTextLog(`${simulation.SVGrightMouse}<strong style='font-size:30px;'> ${m.fieldUpgrades[m.fieldMode].name}</strong><br><span class='faded'></span><br>${m.fieldUpgrades[m.fieldMode].description}`, 600);
|
||||||
// simulation.makeTextLog(`
|
// simulation.makeTextLog(`
|
||||||
// input.key.up <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.up}</span>", "<span class='color-text'>ArrowUp</span>"]
|
// input.key.up <span class='color-symbol'>=</span> ["<span class='color-text'>${input.key.up}</span>", "<span class='color-text'>ArrowUp</span>"]
|
||||||
@@ -751,6 +757,7 @@ const simulation = {
|
|||||||
if (b.guns[i].name === "mine") {
|
if (b.guns[i].name === "mine") {
|
||||||
if (tech.isCrouchAmmo) count = Math.ceil(count / 2)
|
if (tech.isCrouchAmmo) count = Math.ceil(count / 2)
|
||||||
b.guns[i].ammo += count
|
b.guns[i].ammo += count
|
||||||
|
if (tech.ammoCap) b.guns[i].ammo = Math.min(tech.ammoCap, b.guns[i].ammo)
|
||||||
simulation.updateGunHUD();
|
simulation.updateGunHUD();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -779,6 +786,7 @@ const simulation = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
simulation.lastLogTime = 0; //clear previous messages
|
||||||
powerUps.totalPowerUps = powerUp.length
|
powerUps.totalPowerUps = powerUp.length
|
||||||
let holdTarget = (m.holdingTarget) ? m.holdingTarget : undefined //if player is holding something this remembers it before it gets deleted
|
let holdTarget = (m.holdingTarget) ? m.holdingTarget : undefined //if player is holding something this remembers it before it gets deleted
|
||||||
tech.deathSpawnsFromBoss = 0;
|
tech.deathSpawnsFromBoss = 0;
|
||||||
|
|||||||
@@ -140,7 +140,9 @@ const spawn = {
|
|||||||
me.chaseSpeed = 3.3
|
me.chaseSpeed = 3.3
|
||||||
me.isMACHO = true;
|
me.isMACHO = true;
|
||||||
me.frictionAir = 0.006
|
me.frictionAir = 0.006
|
||||||
|
me.onDeath = function() {
|
||||||
|
tech.isHarmMACHO = false;
|
||||||
|
}
|
||||||
me.do = function() {
|
me.do = function() {
|
||||||
const sine = Math.sin(simulation.cycle * 0.015)
|
const sine = Math.sin(simulation.cycle * 0.015)
|
||||||
this.radius = 370 * (1 + 0.1 * sine)
|
this.radius = 370 * (1 + 0.1 * sine)
|
||||||
|
|||||||
762
js/tech.js
762
js/tech.js
File diff suppressed because it is too large
Load Diff
@@ -129,6 +129,14 @@ summary {
|
|||||||
transition: opacity 5s ease-in;
|
transition: opacity 5s ease-in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#training-button {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 58px;
|
||||||
|
right: 4px;
|
||||||
|
z-index: 12;
|
||||||
|
transition: opacity 5s ease-in;
|
||||||
|
}
|
||||||
|
|
||||||
#construct {
|
#construct {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
58
todo.txt
58
todo.txt
@@ -1,20 +1,67 @@
|
|||||||
******************************************************** NEXT PATCH **************************************************
|
******************************************************** NEXT PATCH **************************************************
|
||||||
|
|
||||||
powerUpBoss no longer gets invulnerability after death
|
first 4 levels of the training maps are live
|
||||||
but powerUpBossBaby still has it
|
this is very much a work in progress, but I'm putting it up for feedback
|
||||||
|
|
||||||
tech: brainstorming - randomize your tech choice menu every 2s for 10s
|
stunned and frozen mobs do no harm by default
|
||||||
JUNK tech: brainstorm - randomize your tech choice menu every 0.5s for 10s
|
removed tech: osmoprotectant - stunned and frozen mobs do no harm
|
||||||
|
|
||||||
|
tech: annelids - randomly increase worm size and damage up to 100%
|
||||||
|
|
||||||
|
weak anthropic principle gives 45->50% duplication chance after almost dieing
|
||||||
|
complex spin-statistics immune to harm for 1.5->1.8 s every 7 s
|
||||||
|
exciton gives 60->66% damage
|
||||||
|
electronegativity gives 1% dmg for every 11->10 stored energy
|
||||||
|
arsenal gives 14->12% more damage per gun
|
||||||
|
pair production is now also a standing wave field tech
|
||||||
|
mass-energy takes 10% less damage
|
||||||
|
JUNK tech black hole cluster spawns mobs farther away, so you have a better chance to survive
|
||||||
|
undefinded tech no longer shows up on your first couple times playing, since it's a distraction for new players
|
||||||
|
|
||||||
******************************************************** TODO ********************************************************
|
******************************************************** TODO ********************************************************
|
||||||
|
|
||||||
|
door.openClose(); is flipped T/F
|
||||||
|
|
||||||
|
balance time dilation with bose einstein (you can freeze everything and take no damage)
|
||||||
|
|
||||||
|
training
|
||||||
|
button takes you to a series of levels that teach simple game mechanics
|
||||||
|
make the button more obvious if the account has only played 1-2 times
|
||||||
|
at high levels has some puzzle aspects?
|
||||||
|
uses the lore voice/text code?
|
||||||
|
save training level progress as local variable
|
||||||
|
rooms:
|
||||||
|
jump over wall and gap
|
||||||
|
crouch through tunnel
|
||||||
|
push block onto button to open door
|
||||||
|
pick up a block an drop onto a button to open door
|
||||||
|
fire block at button to open door
|
||||||
|
fire block at mob to open door
|
||||||
|
pick up power ups with field to open door
|
||||||
|
use gun to kill a mob and use it's block body to activate a button to open a door
|
||||||
|
use field to deflect a mob that is stationary, but blocking a passage
|
||||||
|
set health to very low
|
||||||
|
final room, takes you back to the menu, like when winning the game
|
||||||
|
puzzle or combat rooms?
|
||||||
|
boss gauntlet, spawn with nothing but a few power ups and fight 10 bosses
|
||||||
|
|
||||||
|
|
||||||
tech: basic research - heal power ups spawn as research power ups instead, and using research heals you (needs to be pretty low, like 3% health)
|
tech: basic research - heal power ups spawn as research power ups instead, and using research heals you (needs to be pretty low, like 3% health)
|
||||||
tech: maintenance - heals no longer spawn, but using research heals you 100%
|
tech: maintenance - heals no longer spawn, but using research heals you 100%
|
||||||
|
|
||||||
|
tech reversed regression - mobs take less damage after each time you hit them, but you get +100% damage
|
||||||
|
maybe a gun tech only?
|
||||||
|
what gun?
|
||||||
|
|
||||||
|
tech extend fracture analysis to give bonus damage to frozen also, but reduce the 400%->300%?
|
||||||
|
|
||||||
pulsar mobs retarget too easily
|
pulsar mobs retarget too easily
|
||||||
also they drift around too much
|
also they drift around too much
|
||||||
|
|
||||||
|
convert blocked mobs into bullets
|
||||||
|
only for the very small bullets that move fast after being blocked
|
||||||
|
delete bulletmob and spawn a nail-like bullet with the same properties as the bulletmob
|
||||||
|
|
||||||
electric motors: increases movement speed and jump height, but jumping and moving costs energy
|
electric motors: increases movement speed and jump height, but jumping and moving costs energy
|
||||||
overwrite the key event listeners?
|
overwrite the key event listeners?
|
||||||
JUNK tech?
|
JUNK tech?
|
||||||
@@ -81,8 +128,7 @@ animate going to next level?
|
|||||||
Plasma Burner: upgrade for plasma torch, basically just a jet engine. does high damage, but short range, mostly for player movement.
|
Plasma Burner: upgrade for plasma torch, basically just a jet engine. does high damage, but short range, mostly for player movement.
|
||||||
maybe reduce gravity to really low then apply a vector away from mouse direction
|
maybe reduce gravity to really low then apply a vector away from mouse direction
|
||||||
|
|
||||||
game idea - auto battler with n-gon mob AI and tech
|
auto-gon - auto battler with n-gon mob AI and tech
|
||||||
name: auto-gon
|
|
||||||
you build a group of mobs and bosses from n-gon
|
you build a group of mobs and bosses from n-gon
|
||||||
they fight other mobs and bosses
|
they fight other mobs and bosses
|
||||||
similar research and tech system to n-gon
|
similar research and tech system to n-gon
|
||||||
|
|||||||
Reference in New Issue
Block a user