diff --git a/js/bullets.js b/js/bullets.js
index 38f0d4a..d73a7f3 100644
--- a/js/bullets.js
+++ b/js/bullets.js
@@ -1029,7 +1029,7 @@ const b = {
name: "drones",
description: "release drones that seek out targets
if no targets, drones move to mouse
",
ammo: 0,
- ammoPack: 21,
+ ammoPack: 20,
have: false,
fire() {
const THRUST = 0.0015
@@ -1042,8 +1042,8 @@ const b = {
friction: 0,
frictionAir: 0.0005,
restitution: 1,
- dmg: 0.15, //damage done in addition to the damage from momentum
- lookFrequency: 79 + Math.floor(32 * Math.random()),
+ dmg: 0.14, //damage done in addition to the damage from momentum
+ lookFrequency: 79 + Math.floor(37 * Math.random()),
endCycle: game.cycle + 780 + 360 * Math.random(),
classType: "bullet",
collisionFilter: {
diff --git a/js/index.js b/js/index.js
index ae13ae8..b0ca090 100644
--- a/js/index.js
+++ b/js/index.js
@@ -68,15 +68,15 @@ add bullet on damage effects
// collision info:
- category mask
-powerUp: 0x100000 0x100001
-body: 0x010000 0x011111
-player: 0x001000 0x010011
-bullet: 0x000100 0x010011
-mob: 0x000010 0x011111
-mobBull: 0x000010 0x011101
-mobshld: 0x000010 0x001100
-map: 0x000001 0x111111
+ category mask
+powerUp: 0x100000 0x100001
+body: 0x010000 0x011111
+player: 0x001000 0x010011
+bullet: 0x000100 0x010011
+mob: 0x000010 0x011111
+mobBullet: 0x000010 0x011101
+mobShield: 0x000010 0x001100
+map: 0x000001 0x111111
diff --git a/js/level.js b/js/level.js
index 5953fd0..3c81900 100644
--- a/js/level.js
+++ b/js/level.js
@@ -6,6 +6,7 @@ let consBB = []; //all constraints between two bodies
//main object for spawning levels
const level = {
maxJump: 390,
+ defaultZoom: 1400,
boostScale: 0.000023,
levels: ["skyscrapers", "rooftops", "warehouse", "highrise", "office", "aerie"],
onLevel: 0,
@@ -16,13 +17,14 @@ const level = {
// game.levelsCleared = 4; //for testing to simulate possible mobs spawns
// b.giveGuns(1) // set a starting gun for testing
// b.giveGuns("all", 1000)
- mech.fieldUpgrades[1]() //give a field power up for testing
- // this.intro(); //starting level
+ // mech.fieldUpgrades[1]() //give a field power up for testing
+
+ this.intro(); //starting level
// this.testingMap();
// this.bosses();
// this.aerie();
// this.rooftops();
- this.warehouse();
+ // this.warehouse();
// this.highrise();
// this.office();
} else {
@@ -126,7 +128,8 @@ const level = {
// }
},
bosses() {
- game.zoomTransition(1500)
+ level.defaultZoom = 1500
+ game.zoomTransition(level.defaultZoom)
// spawn.setSpawnList();
// spawn.setSpawnList();
@@ -136,15 +139,15 @@ const level = {
// b.dmgScale *= 0.9; //damage done by player decreases each level
// }
- document.body.style.backgroundColor = "#444";
+ document.body.style.backgroundColor = "#fff";
- level.fillBG.push({
- x: -150,
- y: -1150,
- width: 7000,
- height: 1200,
- color: "#eee"
- });
+ // level.fillBG.push({
+ // x: -150,
+ // y: -1150,
+ // width: 7000,
+ // height: 1200,
+ // color: "#eee"
+ // });
level.fill.push({
x: 6400,
@@ -161,9 +164,9 @@ const level = {
level.exit.y = -230;
this.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel");
- spawn.mapRect(-250, 0, 7000, 200); //ground
- spawn.mapRect(-350, -1200, 200, 1400); //left wall
- spawn.mapRect(-250, -1200, 7000, 200); //roof
+ spawn.mapRect(-950, 0, 8200, 800); //ground
+ spawn.mapRect(-950, -1200, 800, 1400); //left wall
+ spawn.mapRect(-950, -1800, 8200, 800); //roof
spawn.mapRect(-250, -700, 1000, 900); // shelf
spawn.mapRect(-250, -1200, 1000, 250); // shelf roof
powerUps.spawnStartingPowerUps(600, -800);
@@ -190,7 +193,7 @@ const level = {
spawn.lineBoss(5000, -200, spawn.allowedBossList[Math.floor(Math.random() * spawn.allowedBossList.length)]);
spawn.mapRect(6400, -1200, 400, 750); //right wall
spawn.mapRect(6400, -200, 400, 300); //right wall
- spawn.mapRect(6700, -1200, 200, 1400); //right wall
+ spawn.mapRect(6700, -1800, 800, 2600); //right wall
spawn.mapRect(level.exit.x, level.exit.y + 20, 100, 100); //exit bump
for (let i = 0; i < 5; ++i) {
@@ -209,7 +212,8 @@ const level = {
intro() {
// b.giveGuns(0, 1000)
game.zoomScale = 1000 //1400 is normal
- game.zoomTransition(1600, 1)
+ level.defaultZoom = 1600
+ game.zoomTransition(level.defaultZoom, 1)
mech.setPosToSpawn(460, -100); //normal spawn
level.enter.x = -1000000; //offscreen
@@ -217,27 +221,7 @@ const level = {
level.exit.x = 2800;
level.exit.y = -335;
this.addZone(level.exit.x, level.exit.y, 100, 30, "nextLevel");
- document.body.style.backgroundColor = "#444";
- //controls instructions
- // game.makeTextLog(
- // "
field stops all objects except player
", 1200); - //stop time while field is active
", 1200); mech.setHoldDefaults(); - // mech.grabRange = 900; - mech.fieldShieldingScale = 12; - // mech.fieldArc = 1; //field covers full 360 degrees - // mech.calculateFieldThreshold(); //run after setting fieldArc, used for powerUp grab and mobPush with lookingAt(mob) - + mech.grabRange = 130 mech.isBodiesAsleep = false; mech.hold = function () { - - function sleep(who) { - for (let i = 0, len = who.length; i < len; ++i) { - if (!who[i].isSleeping) who[i].storeVelocity = who[i].velocity - Matter.Sleeping.set(who[i], true) - } - } - if (mech.isHolding) { mech.wakeCheck(); mech.drawHold(mech.holdingTarget); mech.holding(); mech.throw(); } else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < mech.cycle) { - const DRAIN = 0.002 //mech.fieldRegen = 0.0015 + const DRAIN = 0.0015 //mech.fieldRegen = 0.0015 if (mech.fieldMeter > DRAIN) { mech.fieldMeter -= DRAIN; - mech.grabPowerUp(); - mech.lookForPickUp(180); //draw field everywhere - ctx.fillStyle = "rgba(255,255,255," + (0.5 + 0.17 * Math.random()) + ")"; + ctx.fillStyle = "rgba(110,170,200," + (0.19 + 0.16 * Math.random()) + ")"; ctx.fillRect(-100000, -100000, 200000, 200000) //stop time mech.isBodiesAsleep = true; + + function sleep(who) { + for (let i = 0, len = who.length; i < len; ++i) { + if (!who[i].isSleeping) { + who[i].storeVelocity = who[i].velocity + who[i].storeAngularVelocity = who[i].angularVelocity + } + Matter.Sleeping.set(who[i], true) + } + } sleep(mob); sleep(body); sleep(bullet); + //doesn't really work, just slows down constraints for (let i = 0, len = cons.length; i < len; i++) { if (cons[i].stiffness !== 0) { cons[i].storeStiffness = cons[i].stiffness; @@ -923,6 +920,9 @@ const mech = { } } game.cycle--; //pause all functions that depend on game cycle increasing + + mech.grabPowerUp(); + mech.lookForPickUp(180); } else { mech.wakeCheck(); mech.fieldCDcycle = mech.cycle + 120; diff --git a/js/powerups.js b/js/powerups.js index 9292775..4ca32d9 100644 --- a/js/powerups.js +++ b/js/powerups.js @@ -33,7 +33,7 @@ const powerUps = { mech.fieldUpgrades[this.mode](); //set a predetermined power up } if (previousMode !== 0) { //pop the old field out in case player wants to swap back - mech.fieldCDcycle = game.cycle + 60; //trigger fieldCD to stop power up grab automatic pick up of spawn + mech.fieldCDcycle = mech.cycle + 40; //trigger fieldCD to stop power up grab automatic pick up of spawn powerUps.spawn(mech.pos.x, mech.pos.y - 15, "field", false, previousMode); } }