From f226965a6c039bb0cbdfee5a62e6fd27f6fbb0a3 Mon Sep 17 00:00:00 2001 From: landgreen Date: Tue, 24 Sep 2019 06:46:12 -0700 Subject: [PATCH] cloacking field graphics --- js/game.js | 1 - js/level.js | 2 +- js/player.js | 11 ++++++++--- js/powerups.js | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/js/game.js b/js/game.js index 89aa3ce..ed6e843 100644 --- a/js/game.js +++ b/js/game.js @@ -644,7 +644,6 @@ const game = { game.fpsInterval = 1000 / game.fpsCap; game.then = Date.now(); requestAnimationFrame(cycle); //starts game loop - game.lastLogTime = game.cycle + 360; }, clearNow: false, clearMap() { diff --git a/js/level.js b/js/level.js index b525bfb..40a5f0b 100644 --- a/js/level.js +++ b/js/level.js @@ -24,7 +24,7 @@ const level = { // game.levelsCleared = 3; //for testing to simulate possible mobs spawns // 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 { 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 diff --git a/js/player.js b/js/player.js index e47d018..092934a 100644 --- a/js/player.js +++ b/js/player.js @@ -796,7 +796,7 @@ const mech = { fieldUpgrades: [ () => { mech.fieldMode = 0; - game.makeTextLog("Field Emitter
(right click or spacebar)

lets you pick up and throw objects
shields you from damage

", 1200); + game.makeTextLog("Field Emitter
(right click or space bar)

lets you pick up and throw objects
shields you from damage

", Infinity); mech.setHoldDefaults(); mech.hold = function () { if (mech.isHolding) { @@ -1062,7 +1062,7 @@ const mech = { mech.fieldMode = 6; game.makeTextLog("Metamaterial Refractive Optics
(right mouse or space bar)

localized invisibility field

", 1200); mech.setHoldDefaults(); - mech.grabRange = 200; + mech.grabRange = 150; mech.fieldArc = 0.1; //0.2 is normal // mech.fieldArc = 1; //field covers full 360 degrees mech.calculateFieldThreshold(); @@ -1081,7 +1081,7 @@ const mech = { mech.isStealth = true //isStealth is checked in mob foundPlayer() //draw stealth field - ctx.fillStyle = "rgba(255,255,255,0.4)"; + ctx.fillStyle = "rgba(255,255,255,0.6)"; ctx.fill(); ctx.beginPath(); ctx.arc(mech.pos.x, mech.pos.y, mech.grabRange - 20, 0, 2 * Math.PI); @@ -1089,6 +1089,11 @@ const mech = { ctx.fill(); 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.grabPowerUp(); mech.pushMobs(); diff --git a/js/powerups.js b/js/powerups.js index 34d380f..fbae832 100644 --- a/js/powerups.js +++ b/js/powerups.js @@ -117,13 +117,13 @@ const powerUps = { if (b.inventory.length === 1) { game.makeTextLog( // "
new gun: " + b.guns[newGun].name + "
E / Q", - "
" + b.guns[newGun].name + "
(left click)

Q, E, and mouse wheel change weapons

", + "
" + b.guns[newGun].name + "
(left click)

Q, E, and mouse wheel change weapons

", 500 ); } else { game.makeTextLog( // "
new gun: " + b.guns[newGun].name + "
E / Q", - "
" + b.guns[newGun].name + "
(left click)", + "
" + b.guns[newGun].name + "
(left click)", 400 ); }