diff --git a/js/bullet.js b/js/bullet.js index fbac69d..8f062a9 100644 --- a/js/bullet.js +++ b/js/bullet.js @@ -388,6 +388,7 @@ const b = { if (Matter.Query.collides(this, map).length > 0) { //touching map if (angle > -0.2 || angle < -1.5) { //don't stick to level ground Matter.Body.setStatic(this, true) //don't set to static if not touching map + this.collisionFilter.mask = cat.map | cat.bullet } else { Matter.Body.setVelocity(this, { x: 0, diff --git a/js/game.js b/js/game.js index 983b8fe..6f3c86a 100644 --- a/js/game.js +++ b/js/game.js @@ -13,7 +13,6 @@ const game = { mech.airControl() } // level.checkZones(); - level.custom(); level.checkQuery(); mech.move(); mech.look(); @@ -23,6 +22,7 @@ const game = { level.drawFillBGs(); level.exit.draw(); level.enter.draw(); + level.custom(); game.draw.powerUp(); mobs.draw(); game.draw.cons(); diff --git a/js/level.js b/js/level.js index 2720069..d094191 100644 --- a/js/level.js +++ b/js/level.js @@ -18,7 +18,7 @@ const level = { // mech.setField("plasma torch") level.intro(); //starting level - // level.bossRoom1() + // level.sewer() // level.testing(); // level.template() // level.bosses(); @@ -68,17 +68,79 @@ const level = { //****************************************************************************************************************** //****************************************************************************************************************** //****************************************************************************************************************** - bossRoom1() { + rotor(x, y, radius = 900, width = 50, density = 0.0002) { + const rotor1 = Matter.Bodies.rectangle(x, y, width, radius, { + density: density, + }); + const rotor2 = Matter.Bodies.rectangle(x, y, width, radius, { + angle: Math.PI / 2, + density: density, + }); + const rotor = Body.create({ //combine rotor1 and rotor2 + parts: [rotor1, rotor2], + // friction: 0, + // frictionAir: 0, + // frictionStatic: 0, + // restitution: 0, + collisionFilter: { + category: cat.body, + mask: cat.body | cat.mob | cat.mobBullet | cat.mobShield | cat.powerUp | cat.player | cat.bullet + }, + }); + Matter.Body.setPosition(rotor, { + x: x, + y: y + }); + World.add(engine.world, [rotor]); + body[body.length] = rotor1 + body[body.length] = rotor2 + + setTimeout(function () { + rotor.collisionFilter.category = cat.body; + rotor.collisionFilter.mask = cat.body | cat.player | cat.bullet | cat.mob | cat.mobBullet //| cat.map + }, 1000); + + const constraint = Constraint.create({ //fix rotor in place, but allow rotation + pointA: { + x: x, + y: y + }, + bodyB: rotor + }); + World.add(engine.world, constraint); + return rotor + }, + sewer() { + const rotor = level.rotor(3050, 1850) + // const rotor2 = level.rotor(3050, 1200) + level.custom = () => { + Matter.Body.applyForce(rotor, { + x: rotor.position.x + 100, + y: rotor.position.y + 100 + }, { + x: 0.001 * rotor.mass, + y: 0 + }) + // Matter.Body.applyForce(rotor2, { + // x: rotor2.position.x + 100, + // y: rotor2.position.y + 100 + // }, { + // x: -0.001 * rotor2.mass, + // y: 0 + // }) + level.playerExitCheck(); }; - level.setPosToSpawn(0, -50); //normal spawn + level.setPosToSpawn(3775, 425); //normal spawn + // level.setPosToSpawn(0, -50); //normal spawn + spawn.mapRect(level.enter.x, level.enter.y + 20, 100, 20); level.exit.x = 1500; level.exit.y = -1875; level.defaultZoom = 1800 game.zoomTransition(level.defaultZoom) - document.body.style.backgroundColor = "#dcdcde"; + document.body.style.backgroundColor = "hsl(138, 3%, 74%)"; // powerUps.spawnStartingPowerUps(1475, -1175); // spawn.debris(750, -2200, 3700, 16); //16 debris per level // level.fill.push({ //foreground @@ -96,7 +158,27 @@ const level = { // color: "#d4d4d7" // }); - spawn.mapRect(-100, 0, 1000, 100); + spawn.mapRect(-400, -500, 100, 600); //left entrance wall + spawn.mapRect(-400, -500, 3800, 100); //ceiling + spawn.mapRect(-400, 0, 3000, 100); //floor + spawn.mapRect(300, -500, 100, 400); //right entrance wall + + + spawn.mapRect(600, -200, 400, 100); + spawn.mapRect(1250, -250, 300, 300); + spawn.mapRect(2000, -150, 300, 200); + + spawn.mapRect(3300, -500, 100, 700); //right down tube wall + spawn.mapRect(3000, 500, 100, 1400); //right down tube wall + spawn.mapRect(3000, 500, 1000, 100); //tube right exit floor + spawn.mapRect(3300, 100, 1000, 100); //tube right exit ceiling + + spawn.mapRect(2500, 0, 100, 1900); //left down tube wall + spawn.mapRect(850, 2300, 2800, 100); + spawn.mapRect(3000, 1800, 600, 100); + + + // spawn.bodyRect(1540, -1110, 300, 25, 0.9); // spawn.boost(4150, 0, 1300); // spawn.randomSmallMob(1300, -70); diff --git a/js/mods.js b/js/mods.js index 92acae4..39e1240 100644 --- a/js/mods.js +++ b/js/mods.js @@ -196,7 +196,7 @@ const mod = { }, { name: "radiative equilibrium", - description: "increase damage by 100%
for 10 seconds after receiving harm", + description: "for 10 seconds after receiving harm
increase damage by 100%", maxCount: 1, count: 0, allowed() { @@ -436,7 +436,7 @@ const mod = { }, { name: "bot replication", - description: "duplicate your permanent bots
remove 90% of your ammo", + description: "duplicate your permanent bots
remove 90% of your ammo", maxCount: 1, count: 0, // isNonRefundable: true, @@ -501,7 +501,7 @@ const mod = { // }, { name: "ablative drones", - description: "rebuild your broken parts as drones
chance to occur after being harmed", + description: "rebuild your broken parts as drones
chance to occur after receiving harm", maxCount: 1, count: 0, allowed() { @@ -540,7 +540,7 @@ const mod = { }, { name: "Pauli exclusion", - description: `after receiving harm from a collision
immune to harm for 1 second`, + description: `after receiving harm from a collision
immune to harm for 1 second`, maxCount: 9, count: 0, allowed() { @@ -557,7 +557,7 @@ const mod = { }, { name: "non-Newtonian armor", - description: "for 10 seconds after receiving harm
reduce harm by 50%", + description: "for 10 seconds after receiving harm
reduce harm by 50%", maxCount: 1, count: 0, allowed() { @@ -573,7 +573,7 @@ const mod = { }, { name: "clock gating", - description: `slow time by 50% after receiving harm
reduce harm by 15%`, + description: `slow time by 50% after receiving harm
reduce harm by 15%`, maxCount: 1, count: 0, allowed() { @@ -595,7 +595,7 @@ const mod = { game.boldActiveGunHUD(); }, 1000); }, - description: "while your first gun is equipped
reduce harm by 16% for each of your guns", + description: "while your first gun is equipped
reduce harm by 16% for each of your guns", maxCount: 1, count: 0, allowed() { @@ -615,7 +615,7 @@ const mod = { }, { name: "piezoelectricity", - description: "colliding with mobs fills your energy
15% less harm from mob collisions", + description: "colliding with mobs fills your energy
15% less harm from mob collisions", maxCount: 1, count: 0, allowed() { @@ -632,7 +632,7 @@ const mod = { }, { name: "ground state", - description: "reduce harm by 50%
you no longer passively regenerate energy", + description: "reduce harm by 50%
you no longer passively regenerate energy", maxCount: 1, count: 0, allowed() { @@ -650,7 +650,7 @@ const mod = { }, { name: "mass-energy equivalence", - description: "energy protects you instead of health
harm reduction effects provide no benefit", + description: "energy protects you instead of health
harm reduction effects provide no benefit", maxCount: 1, count: 0, allowed() { @@ -818,198 +818,6 @@ const mod = { mod.recursiveHealing = 1; } }, - { - name: "bubble fusion", - description: "after destroying a mob's shield
spawn 3 heals, ammo, or rerolls", - maxCount: 1, - count: 0, - allowed() { - return true - }, - requires: "", - effect() { - mod.isShieldAmmo = true; - }, - remove() { - mod.isShieldAmmo = false; - } - }, - { - name: "Bayesian inference", - description: "40% chance for double power ups to drop
ammo will no longer spawn from mobs", - maxCount: 1, - count: 0, - allowed() { - return true - }, - requires: "", - effect: () => { - mod.bayesian = 0.4; - }, - remove() { - mod.bayesian = 0; - } - }, - { - name: "logistics", - description: "ammo power ups add to your current gun
spawn 5 ammo", - maxCount: 1, - count: 0, - allowed() { - return b.inventory.length > 1 - }, - requires: "at least 2 guns", - effect() { - mod.isAmmoForGun = true; - for (let i = 0; i < 5; i++) { - powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); - if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); - } - }, - remove() { - mod.isAmmoForGun = false; - } - }, - { - name: "supply chain", - description: "double your current ammo for all guns", - maxCount: 9, - count: 0, - isNonRefundable: true, - allowed() { - return mod.isAmmoForGun - }, - requires: "logistics", - effect() { - for (let i = 0; i < b.guns.length; i++) { - if (b.guns[i].have) b.guns[i].ammo = Math.floor(2 * b.guns[i].ammo) - } - game.makeGunHUD(); - }, - remove() {} - }, - { - name: "catabolism", - description: "gain ammo when you fire while out of ammo
drains 2% of max health", - maxCount: 1, - count: 0, - allowed() { - return !mod.isEnergyHealth - }, - requires: "not mass-energy equivalence", - effect: () => { - mod.isAmmoFromHealth = 0.02; - }, - remove() { - mod.isAmmoFromHealth = 0; - } - }, - { - name: "desublimated ammunition", - description: "use 50% less ammo when crouching", - maxCount: 1, - count: 0, - allowed() { - return true - }, - requires: "", - effect() { - mod.isCrouchAmmo = true - }, - remove() { - mod.isCrouchAmmo = false; - } - }, - { - name: "gun turret", - description: "reduce harm by 50% when crouching", - maxCount: 1, - count: 0, - allowed() { - return mod.isCrouchAmmo - }, - requires: "desublimated ammunition", - effect() { - mod.isTurret = true - }, - remove() { - mod.isTurret = false; - } - }, - { - name: "cardinality", - description: "2 extra choices for mods, guns, and fields", - maxCount: 1, - count: 0, - allowed() { - return !mod.isDeterminism - }, - requires: "not determinism", - effect: () => { - mod.isExtraChoice = true; - }, - remove() { - mod.isExtraChoice = false; - } - }, - { - name: "determinism", - description: "spawn 5 mods
mods, guns, and fields have only 1 choice", - maxCount: 1, - count: 0, - isNonRefundable: true, - allowed() { - return !mod.isExtraChoice - }, - requires: "not cardinality", - effect: () => { - mod.isDeterminism = true; - for (let i = 0; i < 5; i++) { //if you change the six also change it in Born rule - powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); - if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); - } - }, - remove() { - mod.isDeterminism = false; - } - }, - { - name: "superdeterminism", - description: "spawn 4 mods
rerolls, guns, and fields no longer spawn", - maxCount: 1, - count: 0, - isNonRefundable: true, - allowed() { - return mod.isDeterminism && !mod.manyWorlds - }, - requires: "determinism", - effect: () => { - mod.isSuperDeterminism = true; - for (let i = 0; i < 4; i++) { //if you change the six also change it in Born rule - powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); - if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); - } - }, - remove() { - mod.isSuperDeterminism = false; - } - }, - { - name: "many-worlds", - description: "after choosing a mod, gun, or field
spawn a reroll, if you have none", - maxCount: 1, - count: 0, - allowed() { - return !mod.isSuperDeterminism - }, - requires: "not superdeterminism", - effect: () => { - mod.manyWorlds = true; - }, - remove() { - mod.manyWorlds = false; - } - }, { name: "anthropic principle", nameInfo: "", @@ -1035,6 +843,199 @@ const mod = { mod.isDeathAvoid = false; } }, + { + name: "bubble fusion", + description: "after destroying a mob's shield
spawn 3 heals, ammo, or rerolls", + maxCount: 1, + count: 0, + allowed() { + return true + }, + requires: "", + effect() { + mod.isShieldAmmo = true; + }, + remove() { + mod.isShieldAmmo = false; + } + }, + { + name: "Bayesian inference", + description: "40% chance for double power ups to drop
ammo will no longer spawn from mobs", + maxCount: 1, + count: 0, + allowed() { + return true + }, + requires: "", + effect: () => { + mod.bayesian = 0.4; + }, + remove() { + mod.bayesian = 0; + } + }, + { + name: "logistics", + description: "ammo power ups add to your current gun
spawn 5 ammo", + maxCount: 1, + count: 0, + allowed() { + return b.inventory.length > 1 + }, + requires: "at least 2 guns", + effect() { + mod.isAmmoForGun = true; + for (let i = 0; i < 5; i++) { + powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); + if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); + } + }, + remove() { + mod.isAmmoForGun = false; + } + }, + { + name: "supply chain", + description: "double your current ammo for all guns", + maxCount: 9, + count: 0, + isNonRefundable: true, + allowed() { + return mod.isAmmoForGun + }, + requires: "logistics", + effect() { + for (let i = 0; i < b.guns.length; i++) { + if (b.guns[i].have) b.guns[i].ammo = Math.floor(2 * b.guns[i].ammo) + } + game.makeGunHUD(); + }, + remove() {} + }, + { + name: "catabolism", + description: "gain ammo when you fire while out of ammo
drains 2% of max health", + maxCount: 1, + count: 0, + allowed() { + return !mod.isEnergyHealth + }, + requires: "not mass-energy equivalence", + effect: () => { + mod.isAmmoFromHealth = 0.02; + }, + remove() { + mod.isAmmoFromHealth = 0; + } + }, + { + name: "desublimated ammunition", + description: "use 50% less ammo when crouching", + maxCount: 1, + count: 0, + allowed() { + return true + }, + requires: "", + effect() { + mod.isCrouchAmmo = true + }, + remove() { + mod.isCrouchAmmo = false; + } + }, + { + name: "gun turret", + description: "reduce harm by 50% when crouching", + maxCount: 1, + count: 0, + allowed() { + return mod.isCrouchAmmo + }, + requires: "desublimated ammunition", + effect() { + mod.isTurret = true + }, + remove() { + mod.isTurret = false; + } + }, + { + name: "cardinality", + description: "mods, fields, and guns have 5 choices", + maxCount: 1, + count: 0, + allowed() { + return !mod.isDeterminism + }, + requires: "not determinism", + effect: () => { + mod.isExtraChoice = true; + }, + remove() { + mod.isExtraChoice = false; + } + }, + { + name: "determinism", + description: "spawn 5 mods
mods, fields, and guns have only 1 choice", + maxCount: 1, + count: 0, + isNonRefundable: true, + allowed() { + return !mod.isExtraChoice + }, + requires: "not cardinality", + effect: () => { + mod.isDeterminism = true; + for (let i = 0; i < 5; i++) { //if you change the six also change it in Born rule + powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); + if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); + } + }, + remove() { + mod.isDeterminism = false; + } + }, + { + name: "superdeterminism", + description: "spawn 4 mods
rerolls, guns, and fields no longer spawn", + maxCount: 1, + count: 0, + isNonRefundable: true, + allowed() { + return mod.isDeterminism && !mod.manyWorlds + }, + requires: "determinism", + effect: () => { + mod.isSuperDeterminism = true; + for (let i = 0; i < 4; i++) { //if you change the six also change it in Born rule + powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); + if (Math.random() < mod.bayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); + } + }, + remove() { + mod.isSuperDeterminism = false; + } + }, + { + name: "many-worlds", + description: "after choosing a mod, field, or gun
spawn a reroll, if you have none", + maxCount: 1, + count: 0, + allowed() { + return !mod.isSuperDeterminism + }, + requires: "not superdeterminism", + effect: () => { + mod.manyWorlds = true; + }, + remove() { + mod.manyWorlds = false; + } + }, + { name: "quantum immortality", description: "after dying, continue in an alternate reality
spawn 5 rerolls", @@ -1198,7 +1199,7 @@ const mod = { }, { name: "shotgun spin-statistics", - description: "firing the shotgun makes you
immune to harm while on cooldown", + description: "firing the shotgun makes you
immune to harm while on cooldown", maxCount: 1, count: 0, allowed() { @@ -1278,7 +1279,7 @@ const mod = { }, { name: "flechettes cartridges", - description: "flechettes release three needles in each shot
ammo cost are increases by 3x", + description: "flechettes release three needles in each shot
ammo cost are increases by 3x", maxCount: 1, count: 0, allowed() { @@ -1472,7 +1473,7 @@ const mod = { }, { name: "optimized shell packing", - description: "flak ammo drops contain 3x more shells", + description: "flak ammo drops contain 3x more shells", maxCount: 3, count: 0, allowed() { @@ -1572,7 +1573,7 @@ const mod = { }, { name: "mine reclamation", - description: "retrieve ammo from all undetonated mines
and 20% of mines after detonation", + description: "retrieve ammo from all undetonated mines
and 20% of mines after detonation", maxCount: 1, count: 0, allowed() { @@ -1855,7 +1856,7 @@ const mod = { }, { name: "timelike world line", - description: "time dilation doubles your time rate
and makes you immune to harm", + description: "time dilation doubles your time rate
and makes you immune to harm", maxCount: 1, count: 0, allowed() { @@ -1911,7 +1912,7 @@ const mod = { }, { name: "degenerate matter", - description: "harm reduction from negative mass field
is increased from 60% to 80%", + description: "harm reduction from negative mass field
is increased from 60% to 80%", maxCount: 1, count: 0, allowed() { @@ -2126,7 +2127,7 @@ const mod = { }, { name: "ammo", - description: "spawn 6 ammo power ups", + description: "spawn 6 ammo power ups", maxCount: 9, count: 0, isNonRefundable: true, @@ -2179,7 +2180,7 @@ const mod = { }, { name: "field", - description: "spawn a field power up", + description: "spawn a field power up", maxCount: 9, count: 0, isNonRefundable: true, diff --git a/js/player.js b/js/player.js index f5e3c94..6f6295f 100644 --- a/js/player.js +++ b/js/player.js @@ -1163,7 +1163,7 @@ const mech = { }, fieldUpgrades: [{ name: "field emitter", - description: "use energy to shield yourself from harm
pick up and throw objects", + description: "use energy to shield yourself from harm
pick up and throw objects", isEasyToAim: false, effect: () => { game.replaceTextLog = true; //allow text over write @@ -1190,7 +1190,7 @@ const mech = { }, { name: "standing wave harmonics", - description: "three oscillating shields are permanently active
reduce harm by 33%", + description: "three oscillating shields are permanently active
reduce harm by 33%", isEasyToAim: true, effect: () => { mech.fieldHarmReduction = 0.67; @@ -1347,7 +1347,7 @@ const mech = { }, { name: "negative mass field", - description: "use energy to nullify   gravity
reduce harm by 60%", + description: "use energy to nullify   gravity
reduce harm by 60%", fieldDrawRadius: 0, isEasyToAim: true, effect: () => { diff --git a/style.css b/style.css index 326898b..10b798d 100644 --- a/style.css +++ b/style.css @@ -460,7 +460,16 @@ em { } .color-g { - color: hsl(218, 100%, 27%); + color: hsl(218, 80%, 40%); + letter-spacing: 1px; +} + +.color-harm { + /* color: */ + /* text-shadow: #FC0 1px 0 10px; */ + background-color: hsla(325, 100%, 85%, 0.2); + padding: 3px; + border-radius: 4px; letter-spacing: 1px; } diff --git a/todo.txt b/todo.txt index 60047fd..7970aa3 100644 --- a/todo.txt +++ b/todo.txt @@ -1,16 +1,4 @@ -drones stop auto grabbing power ups when you have crystallized armor -mod - non-Newtonian armor: take 50% less harm for 10 seconds after getting hit -radiative equilibrium damage lasts 10s after getting hit (up from 5s) -fluoroantimonic acid mod simplified- now gives 40% damage when your base health is above 100% -mod - gun turret: take 50% less harm while crouched - -boss mob power up drop rework: - easy and normal have about a 66% chance - hard has a 100% chance - why has a 133% chance, plus a bonus 60% chance for a second power up - if you miss a roll, your odds double on the next roll - for each level above level 10 you need to roll 10% higher to get a power up ************** TODO - n-gon ************** @@ -26,6 +14,7 @@ medium caliber gun in between minigun and rail gun mod: electricity damages mobs that get near the bullet get ammo back if it hits mobs ammo returns to you if it misses + bullets have a gentle arc? mob that flashes the player (makes the graphics not update for a couple seconds) @@ -52,9 +41,6 @@ mod: bot very slowly follows you and gives you a bonus when it's in range it moves through walls effect: damage bonus?, damage reduction?, push away mobs, limit top speed of mobs/blocks/player? -pulse and laser can auto aim - can hit multiple targets if they are in range - make a visual indication of max health shrink font on small screens (so you can see 5 options on power ups)