big fixes
rail gun shield leveraged investments and born rule
This commit is contained in:
@@ -815,7 +815,7 @@ const b = {
|
|||||||
bullet = [];
|
bullet = [];
|
||||||
|
|
||||||
let count = b.modCount
|
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
|
for (let i = 0; i < count; i++) { // spawn new mods
|
||||||
powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
|
powerUps.spawn(mech.pos.x, mech.pos.y, "mod");
|
||||||
}
|
}
|
||||||
@@ -3325,11 +3325,13 @@ const b = {
|
|||||||
if (who.shield) {
|
if (who.shield) {
|
||||||
for (let i = 0, len = mob.length; i < len; i++) {
|
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
|
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], {
|
Matter.Body.setVelocity(mob[i], Matter.Vector.mult(Matter.Vector.normalise(this.velocity), 10));
|
||||||
x: mob[i].velocity.x + force.x,
|
|
||||||
y: mob[i].velocity.y + force.y
|
// 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
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
js/level.js
11
js/level.js
@@ -15,12 +15,12 @@ const level = {
|
|||||||
if (build.isURLBuild && level.levelsCleared === 0) build.onLoadPowerUps();
|
if (build.isURLBuild && level.levelsCleared === 0) build.onLoadPowerUps();
|
||||||
if (level.levelsCleared === 0) { //this code only runs on the first level
|
if (level.levelsCleared === 0) { //this code only runs on the first level
|
||||||
// level.difficultyIncrease(9)
|
// level.difficultyIncrease(9)
|
||||||
// b.giveGuns("vacuum bomb")
|
b.giveGuns("rail gun")
|
||||||
// mech.setField("pilot wave")
|
// mech.setField("pilot wave")
|
||||||
// b.giveMod("nonlocality");
|
// b.giveMod("nonlocality");
|
||||||
|
|
||||||
level.intro(); //starting level
|
// level.intro(); //starting level
|
||||||
// level.testing();
|
level.testing();
|
||||||
// level.stronghold()
|
// level.stronghold()
|
||||||
// level.bosses();
|
// level.bosses();
|
||||||
// level.satellite();
|
// level.satellite();
|
||||||
@@ -148,8 +148,9 @@ const level = {
|
|||||||
spawn.mapRect(6700, -1800, 800, 2600); //right wall
|
spawn.mapRect(6700, -1800, 800, 2600); //right wall
|
||||||
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
|
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
|
||||||
|
|
||||||
// spawn.laserBoss(2900, -500)
|
// spawn.bomberBoss(2900, -500)
|
||||||
spawn.striker(1200, -500)
|
spawn.hopper(1200, -500)
|
||||||
|
spawn.hopper(1200, -500)
|
||||||
// spawn.timeSkipBoss(2900, -500)
|
// spawn.timeSkipBoss(2900, -500)
|
||||||
// spawn.randomMob(1600, -500)
|
// spawn.randomMob(1600, -500)
|
||||||
|
|
||||||
|
|||||||
17
js/player.js
17
js/player.js
@@ -1828,17 +1828,22 @@ const mech = {
|
|||||||
const off2 = 1 - 0.06 * Math.sin(mech.fieldPhase);
|
const off2 = 1 - 0.06 * Math.sin(mech.fieldPhase);
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.ellipse(mech.pos.x, mech.pos.y, radius * off1, radius * off2, rotate, 0, 2 * Math.PI);
|
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)) {
|
if (mech.fireCDcycle > mech.cycle && (keys[32] || game.mouseDownRight)) {
|
||||||
ctx.lineWidth = 5;
|
ctx.lineWidth = 5;
|
||||||
ctx.strokeStyle = `rgba(0, 204, 255,1)`
|
ctx.strokeStyle = `rgba(0, 204, 255,1)`
|
||||||
ctx.stroke()
|
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()
|
mech.isStealth = false //isStealth disables most uses of foundPlayer()
|
||||||
|
|||||||
2
todo.txt
2
todo.txt
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
************** TODO - n-gon **************
|
************** TODO - n-gon **************
|
||||||
|
|
||||||
mod pilot wave - nonlocality: works out of LOS
|
|
||||||
|
|
||||||
an effect when canceling a power up
|
an effect when canceling a power up
|
||||||
ammo? heals?
|
ammo? heals?
|
||||||
50% chance for a mod, 25% heal, 25% ammo
|
50% chance for a mod, 25% heal, 25% ammo
|
||||||
|
|||||||
Reference in New Issue
Block a user