block pick up range adjust

This commit is contained in:
lilgreenland
2020-03-09 15:22:52 -07:00
parent 2150038f74
commit f67cb30318
3 changed files with 8 additions and 8 deletions

View File

@@ -1234,14 +1234,12 @@ const b = {
game.updateGunHUD(); game.updateGunHUD();
} }
} else { } else {
if (b.isModAmmoFromHealth && mech.health > b.isModAmmoFromHealth) { if (b.isModAmmoFromHealth && mech.health > b.isModAmmoFromHealth) {
mech.damage(b.isModAmmoFromHealth * mech.health); mech.damage(b.isModAmmoFromHealth * mech.health);
powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
if (Math.random() < b.isModBayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo"); if (Math.random() < b.isModBayesian) powerUps.spawn(mech.pos.x, mech.pos.y, "ammo");
} }
mech.fireCDcycle = mech.cycle + 30; //fire cooldown mech.fireCDcycle = mech.cycle + 30; //fire cooldown
// game.makeTextLog("<div style='font-size:140%;'>NO AMMO</div><strong class = 'box'>E</strong> / <strong class = 'box'>Q</strong>", 200);
game.replaceTextLog = true; game.replaceTextLog = true;
game.makeTextLog("<div style='font-size:140%;'>NO AMMO</div> <p style='font-size:90%;'><strong>Q</strong>, <strong>E</strong>, and <strong>mouse wheel</strong> change weapons</p>", 200); game.makeTextLog("<div style='font-size:140%;'>NO AMMO</div> <p style='font-size:90%;'><strong>Q</strong>, <strong>E</strong>, and <strong>mouse wheel</strong> change weapons</p>", 200);
} }
@@ -1264,7 +1262,6 @@ const b = {
} }
} }
} }
//draw //draw
ctx.beginPath(); ctx.beginPath();
for (let i = 0, len = bullet.length; i < len; i++) { for (let i = 0, len = bullet.length; i < len; i++) {
@@ -2084,11 +2081,10 @@ const b = {
if (gun === b.guns[i].name) gun = i if (gun === b.guns[i].name) gun = i
} }
} }
if (!b.guns[gun].have) b.inventory.push(gun); if (!b.guns[gun].have) b.inventory.push(gun);
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun
b.guns[gun].have = true; b.guns[gun].have = true;
b.guns[gun].ammo = Math.floor(b.guns[gun].ammoPack * ammoPacks); b.guns[gun].ammo = Math.floor(b.guns[gun].ammoPack * ammoPacks);
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun
} }
game.makeGunHUD(); game.makeGunHUD();
}, },

View File

@@ -895,7 +895,7 @@ const mech = {
ctx.stroke(); ctx.stroke();
}, },
grabPowerUp() { //look for power ups to grab with field grabPowerUp() { //look for power ups to grab with field
const grabPowerUpRange2 = (mech.fieldRange + 220) * (mech.fieldRange + 220) const grabPowerUpRange2 = 156000 //(mech.fieldRange + 220) * (mech.fieldRange + 220)
for (let i = 0, len = powerUp.length; i < len; ++i) { for (let i = 0, len = powerUp.length; i < len; ++i) {
const dxP = mech.pos.x - powerUp[i].position.x; const dxP = mech.pos.x - powerUp[i].position.x;
const dyP = mech.pos.y - powerUp[i].position.y; const dyP = mech.pos.y - powerUp[i].position.y;
@@ -1024,11 +1024,11 @@ const mech = {
// } // }
// } // }
// }, // },
lookForPickUp(range = mech.fieldRange) { //find body to pickup lookForPickUp() { //find body to pickup
mech.energy -= mech.fieldRegen; mech.energy -= mech.fieldRegen;
const grabbing = { const grabbing = {
targetIndex: null, targetIndex: null,
targetRange: range, targetRange: 150,
// lookingAt: false //false to pick up object in range, but not looking at // lookingAt: false //false to pick up object in range, but not looking at
}; };
for (let i = 0, len = body.length; i < len; ++i) { for (let i = 0, len = body.length; i < len; ++i) {

View File

@@ -1,5 +1,9 @@
************** TODO - n-gon ************** ************** TODO - n-gon **************
consider using the "e" key for picking up blocks and just q for gun swaps
good for: plasma torch, time dilation, negative mass
bad for: basic, nano-scale, harmonic
mod - status effects last 1 second longer mod - status effects last 1 second longer
wait until you have more status effects written wait until you have more status effects written