diff --git a/js/bullets.js b/js/bullets.js index 9a038d6..fc57a8e 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -815,7 +815,7 @@ const b = { bullet = []; let count = b.modCount - if (b.isModNoAmmo) count - 5 //remove the 5 bonus mods when getting rid of leveraged investment + if (b.isModNoAmmo) count -= 5 //remove the 5 bonus mods when getting rid of leveraged investment for (let i = 0; i < count; i++) { // spawn new mods powerUps.spawn(mech.pos.x, mech.pos.y, "mod"); } @@ -3325,11 +3325,13 @@ const b = { if (who.shield) { for (let i = 0, len = mob.length; i < len; i++) { if (mob[i].id === who.shieldTargetID) { //apply some knock back to shield mob before shield breaks - const force = Matter.Vector.mult(this.velocity, 7 / mob[i].mass) - Matter.Body.setVelocity(mob[i], { - x: mob[i].velocity.x + force.x, - y: mob[i].velocity.y + force.y - }); + + Matter.Body.setVelocity(mob[i], Matter.Vector.mult(Matter.Vector.normalise(this.velocity), 10)); + + // const force = Matter.Vector.mult(this.velocity, 4 / mob[i].mass) + // const velocity = Matter.Vector.add(force, mob[i].velocity) + // Matter.Body.setVelocity(mob[i], velocity); + break } } diff --git a/js/level.js b/js/level.js index e2a1caa..8ed243b 100644 --- a/js/level.js +++ b/js/level.js @@ -15,12 +15,12 @@ const level = { if (build.isURLBuild && level.levelsCleared === 0) build.onLoadPowerUps(); if (level.levelsCleared === 0) { //this code only runs on the first level // level.difficultyIncrease(9) - // b.giveGuns("vacuum bomb") + b.giveGuns("rail gun") // mech.setField("pilot wave") // b.giveMod("nonlocality"); - level.intro(); //starting level - // level.testing(); + // level.intro(); //starting level + level.testing(); // level.stronghold() // level.bosses(); // level.satellite(); @@ -148,8 +148,9 @@ const level = { spawn.mapRect(6700, -1800, 800, 2600); //right wall spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump - // spawn.laserBoss(2900, -500) - spawn.striker(1200, -500) + // spawn.bomberBoss(2900, -500) + spawn.hopper(1200, -500) + spawn.hopper(1200, -500) // spawn.timeSkipBoss(2900, -500) // spawn.randomMob(1600, -500) diff --git a/js/player.js b/js/player.js index e97ab6d..91e746b 100644 --- a/js/player.js +++ b/js/player.js @@ -1828,17 +1828,22 @@ const mech = { const off2 = 1 - 0.06 * Math.sin(mech.fieldPhase); ctx.beginPath(); ctx.ellipse(mech.pos.x, mech.pos.y, radius * off1, radius * off2, rotate, 0, 2 * Math.PI); - ctx.fillStyle = "#fff" //`rgba(0,0,0,${0.5+0.5*mech.energy})`; - ctx.globalCompositeOperation = "destination-in"; //in or atop - ctx.fill(); - ctx.globalCompositeOperation = "source-over"; - ctx.clip(); - if (mech.fireCDcycle > mech.cycle && (keys[32] || game.mouseDownRight)) { ctx.lineWidth = 5; ctx.strokeStyle = `rgba(0, 204, 255,1)` ctx.stroke() } + if (b.modRenormalization) { + for (let i = 0; i < bullet.length; i++) { + ctx.moveTo(bullet[i].position.x, bullet[i].position.y) + ctx.arc(bullet[i].position.x, bullet[i].position.y, radius, 0, 2 * Math.PI); + } + } + ctx.fillStyle = "#fff" //`rgba(0,0,0,${0.5+0.5*mech.energy})`; + ctx.globalCompositeOperation = "destination-in"; //in or atop + ctx.fill(); + ctx.globalCompositeOperation = "source-over"; + ctx.clip(); } mech.isStealth = false //isStealth disables most uses of foundPlayer() diff --git a/todo.txt b/todo.txt index 0db43dc..b964be3 100644 --- a/todo.txt +++ b/todo.txt @@ -3,8 +3,6 @@ ************** TODO - n-gon ************** -mod pilot wave - nonlocality: works out of LOS - an effect when canceling a power up ammo? heals? 50% chance for a mod, 25% heal, 25% ammo