bug fixes and balance

This commit is contained in:
landgreen
2020-01-08 17:55:17 -08:00
parent e63367d103
commit 9c2433d50d
5 changed files with 32 additions and 32 deletions

View File

@@ -1627,19 +1627,16 @@ const b = {
bullet[me].do = function () { bullet[me].do = function () {
this.force.y += this.mass * 0.002; //extra gravity this.force.y += this.mass * 0.002; //extra gravity
if (this.cycle > 10) { ctx.beginPath(); //draw block as grey
ctx.setLineDash([40, 100]); ctx.moveTo(this.vertices[0].x, this.vertices[0].y);
ctx.lineWidth = 1 for (let j = 1; j < this.vertices.length; j += 1) {
ctx.strokeStyle = "#357"; ctx.lineTo(this.vertices[j].x, this.vertices[j].y);
ctx.beginPath();
ctx.arc(this.position.x, this.position.y, 650, 0, 2 * Math.PI);
ctx.stroke();
ctx.setLineDash([0, 0]);
this.cycle++
} else if (this.speed < 1 && !mech.isBodiesAsleep) {
this.cycle++
} }
ctx.lineTo(this.vertices[0].x, this.vertices[0].y);
ctx.fillStyle = "#457";
ctx.fill();
if (this.speed < 1 && !mech.isBodiesAsleep) this.cycle++
if (this.cycle > 40) { if (this.cycle > 40) {
this.do = function () { this.do = function () {
this.force.y += this.mass * 0.002; //extra gravity this.force.y += this.mass * 0.002; //extra gravity

View File

@@ -21,6 +21,7 @@ const level = {
level.intro(); //starting level level.intro(); //starting level
// level.testingMap(); // level.testingMap();
// level.bosses(); // level.bosses();
// level.skyscrapers();
// level.aerie(); // level.aerie();
// level.rooftops(); // level.rooftops();
// level.warehouse(); // level.warehouse();
@@ -394,7 +395,7 @@ const level = {
level.enter.y = mech.spawnPos.y + 20; level.enter.y = mech.spawnPos.y + 20;
level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel"); level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel");
spawn.debris(1650, -1800, 3800, 20); //20 debris per level spawn.debris(1650, -1800, 3800, 16); //16 debris per level
powerUps.spawnStartingPowerUps(2450, -1675); powerUps.spawnStartingPowerUps(2450, -1675);
//foreground //foreground
@@ -544,7 +545,7 @@ const level = {
level.defaultZoom = 2100 level.defaultZoom = 2100
game.zoomTransition(level.defaultZoom) game.zoomTransition(level.defaultZoom)
const backwards = (Math.random() < 0.75) ? false : true; const backwards = (Math.random() < 0.25 && game.difficulty > 8) ? true : false;
if (backwards) { if (backwards) {
mech.setPosToSpawn(4000, -3300); //normal spawn mech.setPosToSpawn(4000, -3300); //normal spawn
level.exit.x = -100; level.exit.x = -100;
@@ -561,10 +562,10 @@ const level = {
level.enter.y = mech.spawnPos.y + 20; level.enter.y = mech.spawnPos.y + 20;
level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel"); level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel");
powerUps.spawnStartingPowerUps(1075, -550); powerUps.spawnStartingPowerUps(1075, -550);
spawn.debris(-250, 50, 1650, 2); //20 debris per level spawn.debris(-250, 50, 1650, 2); //16 debris per level
spawn.debris(2475, 0, 750, 2); //20 debris per level spawn.debris(2475, 0, 750, 2); //16 debris per level
spawn.debris(3450, 0, 2000, 20); //20 debris per level spawn.debris(3450, 0, 2000, 16); //16 debris per level
spawn.debris(3500, -2350, 1500, 2); //20 debris per level spawn.debris(3500, -2350, 1500, 2); //16 debris per level
document.body.style.backgroundColor = "#dcdcde"; document.body.style.backgroundColor = "#dcdcde";
//foreground //foreground
@@ -730,7 +731,7 @@ const level = {
level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel"); level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel");
powerUps.spawnStartingPowerUps(1475, -1175); powerUps.spawnStartingPowerUps(1475, -1175);
spawn.debris(0, -2200, 4500, 20); //20 debris per level spawn.debris(750, -2200, 3700, 16); //16 debris per level
document.body.style.backgroundColor = "#dcdcde"; document.body.style.backgroundColor = "#dcdcde";
//foreground //foreground
@@ -885,10 +886,10 @@ const level = {
// spawn.laserZone(-550, -350, 10, 400, 0.3) // spawn.laserZone(-550, -350, 10, 400, 0.3)
// spawn.deathQuery(-550, -350, 50, 400) // spawn.deathQuery(-550, -350, 50, 400)
// spawn.debris(-3950, -2575, 1050, 4); //20 debris per level // spawn.debris(-3950, -2575, 1050, 4); //16 debris per level
spawn.debris(-2325, -1825, 2400); //20 debris per level spawn.debris(-2325, -1825, 2400); //16 debris per level
spawn.debris(-2625, -600, 600, 6); //20 debris per level spawn.debris(-2625, -600, 600, 5); //16 debris per level
spawn.debris(-2000, -60, 1200, 6); //20 debris per level spawn.debris(-2000, -60, 1200, 5); //16 debris per level
// if (!game.difficulty) powerUps.spawn(2450, -1675, "gun", false); // if (!game.difficulty) powerUps.spawn(2450, -1675, "gun", false);
//background //background
level.fillBG.push({ level.fillBG.push({
@@ -1059,9 +1060,9 @@ const level = {
level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel"); level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel");
//level.addQueryRegion(-600, -250, 180, 420, "death", [[player]],{}); //level.addQueryRegion(-600, -250, 180, 420, "death", [[player]],{});
spawn.debris(-2250, 1330, 3000, 7); //20 debris per level spawn.debris(-2250, 1330, 3000, 6); //16 debris per level
spawn.debris(-3000, -800, 3280, 7); //20 debris per level spawn.debris(-3000, -800, 3280, 6); //16 debris per level
spawn.debris(-1400, 410, 2300, 6); //20 debris per level spawn.debris(-1400, 410, 2300, 5); //16 debris per level
powerUps.spawnStartingPowerUps(25, 500); powerUps.spawnStartingPowerUps(25, 500);
//foreground //foreground
@@ -1284,10 +1285,10 @@ const level = {
//mech.setPosToSpawn(600, -1200); //normal spawn //mech.setPosToSpawn(600, -1200); //normal spawn
//mech.setPosToSpawn(525, -150); //ground first building //mech.setPosToSpawn(525, -150); //ground first building
//mech.setPosToSpawn(3150, -700); //near exit spawn //mech.setPosToSpawn(3150, -700); //near exit spawn
spawn.debris(-300, -200, 1000, 5); //ground debris //20 debris per level spawn.debris(-300, -200, 1000, 4); //ground debris //16 debris per level
spawn.debris(3500, -200, 800, 5); //ground debris //20 debris per level spawn.debris(3500, -200, 800, 4); //ground debris //16 debris per level
spawn.debris(-300, -650, 1200, 5); //1st floor debris //20 debris per level spawn.debris(-300, -650, 1200, 4); //1st floor debris //16 debris per level
spawn.debris(3500, -650, 800, 5); //1st floor debris //20 debris per level spawn.debris(3500, -650, 800, 5); //1st floor debris //16 debris per level
powerUps.spawnStartingPowerUps(-525, -700); powerUps.spawnStartingPowerUps(-525, -700);
spawn.mapRect(-600, 25, 5600, 300); //ground spawn.mapRect(-600, 25, 5600, 300); //ground

View File

@@ -1020,7 +1020,7 @@ const mobs = {
body[len].collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet; body[len].collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet;
//large mobs or too many bodies go intangible and fall until removed from game to help performance //large mobs or too many bodies go intangible and fall until removed from game to help performance
if (body[len].mass > 10 || 40 + 30 * Math.random() < body.length) { if (body[len].mass > 10 || 45 + 10 * Math.random() < body.length) {
body[len].collisionFilter.mask = cat.player | cat.bullet | cat.mob | cat.mobBullet; body[len].collisionFilter.mask = cat.player | cat.bullet | cat.mob | cat.mobBullet;
} }
body[len].classType = "body"; body[len].classType = "body";

View File

@@ -270,7 +270,9 @@ const powerUps = {
} }
}, },
spawnStartingPowerUps(x, y) { //used for map specific power ups, mostly to give player a starting gun spawnStartingPowerUps(x, y) { //used for map specific power ups, mostly to give player a starting gun
if (b.inventory.length < 2) { if (b.modCount < 1) {
powerUps.spawn(x, y, "mod", false); //starting gun
} else if (b.inventory.length < 2) {
powerUps.spawn(x, y, "gun", false); //starting gun powerUps.spawn(x, y, "gun", false); //starting gun
} else { } else {
powerUps.spawnRandomPowerUp(x, y); powerUps.spawnRandomPowerUp(x, y);

View File

@@ -1581,7 +1581,7 @@ const spawn = {
color: "#f0f0f3" color: "#f0f0f3"
}); });
}, },
debris(x, y, width, number = Math.floor(3 + Math.random() * 11)) { debris(x, y, width, number = Math.floor(2 + Math.random() * 9)) {
for (let i = 0; i < number; ++i) { for (let i = 0; i < number; ++i) {
if (Math.random() < 0.15) { if (Math.random() < 0.15) {
powerUps.chooseRandomPowerUp(x + Math.random() * width, y); powerUps.chooseRandomPowerUp(x + Math.random() * width, y);