From 67fc1a0e3769f6177622293d20928017cf8655cb Mon Sep 17 00:00:00 2001 From: landgreen Date: Sat, 28 Mar 2020 07:26:13 -0700 Subject: [PATCH] crouch bug fix, laserBoss balance --- js/bullets.js | 10 +-- js/level.js | 216 +++++++++++++++++++++++++++++++++++++++++++++++++- js/player.js | 2 +- js/spawn.js | 7 +- todo.txt | 15 +--- 5 files changed, 228 insertions(+), 22 deletions(-) diff --git a/js/bullets.js b/js/bullets.js index 663e337..2573654 100644 --- a/js/bullets.js +++ b/js/bullets.js @@ -1902,10 +1902,10 @@ const b = { inertia: Infinity, friction: 0, frictionAir: 0.10, - restitution: 0.2, - dmg: 0.25, //damage done in addition to the damage from momentum + restitution: 0.3, + dmg: 0.3, //damage done in addition to the damage from momentum lookFrequency: 10 + Math.floor(7 * Math.random()), - endCycle: game.cycle + 90 * b.isModBulletsLastLonger, //Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger), + endCycle: game.cycle + 120 * b.isModBulletsLastLonger, //Math.floor((1200 + 420 * Math.random()) * b.isModBulletsLastLonger), classType: "bullet", collisionFilter: { category: cat.bullet, @@ -1917,14 +1917,14 @@ const b = { onDmg(who) { mobs.statusSlow(who, 30) this.endCycle = game.cycle - if (b.isModAlphaRadiation) mobs.statusPoison(who, 0.08, 180) + if (b.isModAlphaRadiation) mobs.statusPoison(who, 0.1, 180) }, onEnd() {}, do() { // this.force.y += this.mass * 0.0002; //find mob targets if (!(game.cycle % this.lookFrequency)) { - const scale = 1 - 0.1 / b.isModBulletsLastLonger //0.9 * b.isModBulletsLastLonger; + const scale = 1 - 0.09 / b.isModBulletsLastLonger //0.9 * b.isModBulletsLastLonger; Matter.Body.scale(this, scale, scale); this.lockedOn = null; let closeDist = Infinity; diff --git a/js/level.js b/js/level.js index 000b64e..d1aa8b2 100644 --- a/js/level.js +++ b/js/level.js @@ -14,13 +14,14 @@ const level = { start() { if (level.levelsCleared === 0) { // level.difficultyIncrease(9) - b.giveGuns("shotgun") + // b.giveGuns("ice IX") // mech.setField("time dilation field") // b.giveMod("quantum immortality"); // b.giveMod("reflective cavity"); level.intro(); //starting level // level.testingMap(); + // level.stronghold() // level.bosses(); // level.satellite(); // level.skyscrapers(); @@ -94,6 +95,219 @@ const level = { }, //****************************************************************************************************************** //****************************************************************************************************************** + stronghold() { // player made level by Francois 👑 from discord + level.defaultZoom = 1400 + + game.zoomTransition(level.defaultZoom) + mech.setPosToSpawn(1900, -10); //normal spawn + level.enter.x = mech.spawnPos.x - 50; + level.enter.y = mech.spawnPos.y - 10; + level.exit.x = -350; + level.exit.y = -1250; + level.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel"); + spawn.mapRect(level.exit.x, level.exit.y + 25, 100, 20); //exit bump + document.body.style.backgroundColor = "#dbdcde"; + spawn.debris(3800, -1480, 300, 12); + spawn.debris(3600, -1130, 200, 2); + + level.fillBG.push({ + x: -500, + y: -1220, + width: 550, + height: -480, + color: "#edf9f9" + }); + level.fillBG.push({ + x: 0, + y: -700, + width: 1050, + height: 700, + color: "rgba(0,0,0,0.1)" + }); + level.fillBG.push({ + x: -550, + y: -1170, + width: 550, + height: 1170, + color: "rgba(0,0,0,0.1)" + }); + + level.fillBG.push({ + x: 1150, + y: -1700, + width: 250, + height: 1700, + color: "rgba(0,0,0,0.1)" + }); + level.fillBG.push({ + x: 1050, + y: -1200, + width: 100, + height: 1200, + color: "rgba(0,0,0,0.1)" + }); + level.fillBG.push({ + x: 1400, + y: -250, + width: 200, + height: -1500, + color: "rgba(0,0,0,0.1)" + }); + level.fillBG.push({ + x: 1600, + y: -550, + width: 600, + height: -1150, + color: "rgba(0,0,0,0.1)" + }); + level.fillBG.push({ + x: 2530, + y: -550, + width: 400, + height: -1450, + color: "rgba(0,0,0,0.1)" + }); + level.fillBG.push({ + x: 3270, + y: -1700, + width: 80, + height: 600, + color: "rgba(0,0,0,0.1)" + }); + level.fillBG.push({ + x: 3350, + y: -1350, + width: 700, + height: 230, + color: "rgba(0,0,0,0.1)" + }); + + level.fillBG.push({ + x: 4050, + y: -1700, + width: 600, + height: 1290, + color: "rgba(0,0,0,0.1)" + }); + level.fillBG.push({ + x: 3650, + y: -110, + width: 1000, + height: 170, + color: "rgba(0,0,0,0.1)" + }); + + + // __________________________________________________________________________________________________ + // Spawn Box + spawn.mapRect(1600, -500, 50, 500); //Left Wall + spawn.mapRect(1600, -550, 1500, 50); //Roof + spawn.mapRect(2300, -500, 50, 300); //Right Wall + + spawn.mapRect(-550, 0, 4300, 200); //ground + spawn.mapRect(3700, 55, 1300, 145); //2nd ground + spawn.mapRect(5000, 0, 50, 200); //Last small part of the ground + spawn.mapRect(3100, -1070, 50, 570); // vertical 2nd roof + spawn.mapRect(3100, -1120, 950, 50); // Horizontal 2nd Roof + spawn.mapRect(4050, -1750, 600, 50); // Roof after lift + spawn.mapRect(4600, -1700, 50, 100); // Petit retour de toit, après ascenseur + + //Spawn "Upstairs" + spawn.mapRect(3650, -160, 400, 50); //Thin Walk + spawn.mapRect(4050, -410, 600, 300); //Large staircase block + spawn.mapRect(4600, -1120, 50, 710); //Left Wall Wall upstairs + spawn.mapRect(4550, -1170, 100, 50); //Bloque ascenseur + spawn.mapVertex(3700, 35, "0 0 450 0 300 -60 150 -60"); //first slope + spawn.mapVertex(4850, 35, "0 0 370 0 370 -65 150 -65"); //second slope + spawn.boost(4865, 0, 1800); // right boost + spawn.bodyRect(3950, -280, 170, 120); //Bloc Marche Pour Monter À Ascenseur + // spawn.bodyRect(-2700, 1150, 100, 160, 1, spawn.propsSlide); //weight + // spawn.bodyRect(-2550, 1150, 200, 100, 1, spawn.propsSlide); //weight + spawn.bodyRect(4050, -500, 275, 100, 1, spawn.propsSlide); //weight + spawn.bodyRect(4235, -500, 275, 100, 1, spawn.propsSlide); //weight + // spawn.bodyRect(-2775, 1300, 400, 100, 1, spawn.propsHoist); //hoist + spawn.bodyRect(4025, -450, 550, 100, 1, spawn.propsHoist); //hoist + cons[cons.length] = Constraint.create({ + pointA: { + x: 4325, + y: -1700, + }, + bodyB: body[body.length - 1], + stiffness: 0.0001217, + length: 200 + }); + + spawn.bodyRect(2799, -870, 310, 290); //Gros bloc angle toit + spawn.mapRect(4000, -1750, 50, 400); //Right Wall Cuve + spawn.mapRect(3400, -1400, 600, 50); // Bottom Cuve + spawn.mapRect(3350, -1750, 50, 400); // Left Wall Cuve + spawn.bodyRect(3400, -1470, 110, 70); //Moyen bloc dans la cuve + spawn.mapRect(3270, -1750, 80, 50); // Rebord gauche cuve + + spawn.mapRect(2530, -2000, 400, 50); //First Plateforme + spawn.mapRect(1600, -1750, 600, 50); // Middle plateforme + spawn.mapRect(1150, -1750, 250, 50); //Derniere plateforme // Toit petite boite en [ + spawn.bodyRect(1830, -1980, 190, 230); // Fat bloc plateforme middle + spawn.bodyRect(1380, -1770, 250, 20) // Pont last plateforme + + spawn.mapRect(1000, -1250, 400, 50); //Sol de la petite boite en [ + spawn.mapRect(1100, -1750, 50, 380); //Mur gauche petite boite en [ + spawn.bodyRect(1100, -1380, 48, 119); //Bloc-porte petite boite en [ + + spawn.mapRect(-100, -750, 1100, 50); //Sol last salle + spawn.mapRect(1000, -1200, 50, 500) // Mur droit last salle + spawn.mapRect(50, -1550, 1050, 50); // Toit last salle + spawn.bodyRect(1, -900, 48, 150); //Bloc porte last salle + spawn.mapRect(0, -1170, 50, 270); //Mur gauche en bas last salle + spawn.bodyRect(920, -900, 120, 120); //Gros bloc last salle + + spawn.mapRect(0, -1700, 50, 320); // Mur droit salle exit / Mur gauche last salle + spawn.mapRect(-550, -1220, 600, 50); // Sol exit room + spawn.mapRect(-500, -1750, 550, 50); // Toit exit room + spawn.mapRect(-550, -1750, 50, 530); // Mur gauche exit room + spawn.bodyRect(-503, -1250, 30, 30); // Petit bloc exit room + + spawn.mapRect(500, -700, 100, 590); //Bloc noir un dessous last salle + spawn.mapRect(1400, -250, 200, 250); //Black Block left from the spawn + spawn.boost(-370, 0, 800); + + map[map.length] = Bodies.polygon(2325, -205, 0, 15); //circle above door + spawn.bodyRect(2325, -180, 15, 170, 1, spawn.propsDoor); // door + body[body.length - 1].isNotHoldable = true; + //makes door swing + consBB[consBB.length] = Constraint.create({ + bodyA: body[body.length - 1], + pointA: { + x: 0, + y: -90 + }, + bodyB: map[map.length - 1], + stiffness: 1 + }); + + spawn.bodyRect(650, 50, 70, 50); + spawn.bodyRect(300, 0, 100, 60); + spawn.bodyRect(400, 0, 100, 150); + spawn.bodyRect(2545, -50, 70, 50); + spawn.bodyRect(2550, 0, 100, 30); + + spawn.randomSmallMob(1000, -400, 1); + spawn.randomSmallMob(2550, -560, 1); + spawn.randomSmallMob(3350, -900, 1); + spawn.randomSmallMob(3600, -1210, 1); + spawn.randomSmallMob(700, -1950, 0.2); + spawn.randomSmallMob(5050, -550); + spawn.randomMob(900, -160, 1); + spawn.randomMob(2360, -820, 0.8); + spawn.randomMob(2700, -2020, 0.8); + spawn.randomMob(3050, -1650, 0.8); + spawn.randomMob(3350, -600, 0.8); + spawn.randomMob(4400, -50, 1); + spawn.randomBoss(1500, -1900, 0.5); + spawn.randomBoss(2350, -850, 1); + spawn.randomBoss(100, -450, 0.9); + if (game.difficulty > 3) spawn.randomLevelBoss(1850, -1400, 1); + }, testingMap() { //start with all guns // level.difficultyIncrease(9) //level 7 on normal, level 4 on hard, level 1.2 on why? diff --git a/js/player.js b/js/player.js index f283bb0..acb6479 100644 --- a/js/player.js +++ b/js/player.js @@ -1021,7 +1021,7 @@ const mech = { } else { mech.drawHold(who); } - mech.holdingTarget = null + // mech.holdingTarget = null //knock backs if (mech.fieldShieldingScale > 0) { const massRoot = Math.sqrt(Math.min(12, Math.max(0.15, who.mass))); // masses above 12 can start to overcome the push back diff --git a/js/spawn.js b/js/spawn.js index d451bce..31c34a6 100644 --- a/js/spawn.js +++ b/js/spawn.js @@ -104,6 +104,7 @@ const spawn = { me.do = function () { this.gravity(); + this.checkStatus(); if (this.seePlayer.recall) { this.seePlayerByDistAndLOS(); this.attraction(); @@ -749,11 +750,13 @@ const spawn = { me.onDeath = function () { powerUps.spawnBossPowerUp(this.position.x, this.position.y) }; - me.rotateVelocity = 0.0035 * Math.sqrt(game.accelScale) * (level.levelsCleared > 8 ? 1 : -1) + me.rotateVelocity = Math.min(0.01, 0.0025 * game.accelScale * game.accelScale) * (level.levelsCleared > 8 ? 1 : -1) me.do = function () { this.fill = '#' + Math.random().toString(16).substr(-6); //flash colors // Matter.Body.rotate(this, -0.003 / (0.3 + this.health)) - Matter.Body.rotate(me, this.rotateVelocity) + // if (!mech.isBodiesAsleep) Matter.Body.rotate(me, this.rotateVelocity) + Matter.Body.setAngle(me, game.cycle * this.rotateVelocity) + // this.torque -= this.inertia * 0.0000025 / (4 + this.health); Matter.Body.setVelocity(this, { x: 0, diff --git a/todo.txt b/todo.txt index c645e2a..4e843fe 100644 --- a/todo.txt +++ b/todo.txt @@ -1,11 +1,8 @@ -shotgun hits harder up close and weaker far away -swarm is now called ice IX and it freezes mobs -mod - ablative mines -acid and negative feedback now tell you when they are active - ************** TODO - n-gon ************** +add a way to run player submitted maps. + MOB stabber - extends one vector like the shooter, but quickly in order to stab mod - frag grenades fire nails on explosion @@ -43,14 +40,6 @@ mod - robot that attack nearby mobs, and delivers a stun status effect use laser bot code for the attack large and 5 sided? -bug - getting stuck in crouch mode - press T to see it visually - happened twice to me so far - once right after selecting a mod with lots of blocks around - I don't think I was holding a block - might have been standing on a block... not sure - running mech.definePlayerMass() fixes it - settings - auto aim at nearest mob settings - custom keys binding