cloacking field graphics

This commit is contained in:
landgreen
2019-09-24 06:46:12 -07:00
parent a6c13eb0a6
commit f226965a6c
4 changed files with 11 additions and 7 deletions

View File

@@ -644,7 +644,6 @@ const game = {
game.fpsInterval = 1000 / game.fpsCap; game.fpsInterval = 1000 / game.fpsCap;
game.then = Date.now(); game.then = Date.now();
requestAnimationFrame(cycle); //starts game loop requestAnimationFrame(cycle); //starts game loop
game.lastLogTime = game.cycle + 360;
}, },
clearNow: false, clearNow: false,
clearMap() { clearMap() {

View File

@@ -24,7 +24,7 @@ const level = {
// game.levelsCleared = 3; //for testing to simulate possible mobs spawns // game.levelsCleared = 3; //for testing to simulate possible mobs spawns
// b.giveGuns(0) // set a starting gun for testing // b.giveGuns(0) // set a starting gun for testing
// mech.fieldUpgrades[1]() //give a field power up for testing mech.fieldUpgrades[7]() //give a field power up for testing
} else { } else {
spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns
this[this.levels[this.onLevel]](); //picks the current map from the the levels array this[this.levels[this.onLevel]](); //picks the current map from the the levels array

View File

@@ -796,7 +796,7 @@ const mech = {
fieldUpgrades: [ fieldUpgrades: [
() => { () => {
mech.fieldMode = 0; mech.fieldMode = 0;
game.makeTextLog("<strong style='font-size:30px;'>Field Emitter</strong><br> (right click or spacebar)<p>lets you pick up and throw objects<br>shields you from damage</p>", 1200); game.makeTextLog("<strong style='font-size:30px;'>Field Emitter</strong><br> (right click or space bar)<p>lets you pick up and throw objects<br>shields you from damage</p>", Infinity);
mech.setHoldDefaults(); mech.setHoldDefaults();
mech.hold = function () { mech.hold = function () {
if (mech.isHolding) { if (mech.isHolding) {
@@ -1062,7 +1062,7 @@ const mech = {
mech.fieldMode = 6; mech.fieldMode = 6;
game.makeTextLog("<strong style='font-size:30px;'>Metamaterial Refractive Optics</strong><br> (right mouse or space bar) <p>localized invisibility field</p>", 1200); game.makeTextLog("<strong style='font-size:30px;'>Metamaterial Refractive Optics</strong><br> (right mouse or space bar) <p>localized invisibility field</p>", 1200);
mech.setHoldDefaults(); mech.setHoldDefaults();
mech.grabRange = 200; mech.grabRange = 150;
mech.fieldArc = 0.1; //0.2 is normal mech.fieldArc = 0.1; //0.2 is normal
// mech.fieldArc = 1; //field covers full 360 degrees // mech.fieldArc = 1; //field covers full 360 degrees
mech.calculateFieldThreshold(); mech.calculateFieldThreshold();
@@ -1081,7 +1081,7 @@ const mech = {
mech.isStealth = true //isStealth is checked in mob foundPlayer() mech.isStealth = true //isStealth is checked in mob foundPlayer()
//draw stealth field //draw stealth field
ctx.fillStyle = "rgba(255,255,255,0.4)"; ctx.fillStyle = "rgba(255,255,255,0.6)";
ctx.fill(); ctx.fill();
ctx.beginPath(); ctx.beginPath();
ctx.arc(mech.pos.x, mech.pos.y, mech.grabRange - 20, 0, 2 * Math.PI); ctx.arc(mech.pos.x, mech.pos.y, mech.grabRange - 20, 0, 2 * Math.PI);
@@ -1089,6 +1089,11 @@ const mech = {
ctx.fill(); ctx.fill();
ctx.globalCompositeOperation = "source-over"; ctx.globalCompositeOperation = "source-over";
ctx.beginPath();
ctx.arc(mech.pos.x, mech.pos.y, mech.grabRange - 20, 0, 2 * Math.PI);
ctx.fillStyle = "rgba(210,230,255,0.5)";
ctx.fill();
mech.drawField(); mech.drawField();
mech.grabPowerUp(); mech.grabPowerUp();
mech.pushMobs(); mech.pushMobs();

View File

@@ -117,13 +117,13 @@ const powerUps = {
if (b.inventory.length === 1) { if (b.inventory.length === 1) {
game.makeTextLog( game.makeTextLog(
// "<div style='font-size:120%;' >new gun: " + b.guns[newGun].name + "</div><span class = 'box'>E</span> / <span class = 'box'>Q</span>", // "<div style='font-size:120%;' >new gun: " + b.guns[newGun].name + "</div><span class = 'box'>E</span> / <span class = 'box'>Q</span>",
"<div style='font-size:150%;'><strong>" + b.guns[newGun].name + "</strong></div> (left click) <br> <p style='font-size:90%;'><strong>Q</strong>, <strong>E</strong>, and <strong>mouse wheel</strong> change weapons</p>", "<div style='font-size:170%;'>" + b.guns[newGun].name + "</div> (left click) <br> <p style='font-size:90%;'><strong>Q</strong>, <strong>E</strong>, and <strong>mouse wheel</strong> change weapons</p>",
500 500
); );
} else { } else {
game.makeTextLog( game.makeTextLog(
// "<div style='font-size:120%;' >new gun: " + b.guns[newGun].name + "</div><span class = 'box'>E</span> / <span class = 'box'>Q</span>", // "<div style='font-size:120%;' >new gun: " + b.guns[newGun].name + "</div><span class = 'box'>E</span> / <span class = 'box'>Q</span>",
"<div style='font-size:150%;'><strong>" + b.guns[newGun].name + "</strong></div> (left click)", "<div style='font-size:170%;'>" + b.guns[newGun].name + "</div> (left click)",
400 400
); );
} }