added localized invisibility field
This commit is contained in:
21
js/index.js
21
js/index.js
@@ -2,17 +2,6 @@
|
||||
/* TODO: *******************************************
|
||||
*****************************************************
|
||||
|
||||
general gun power ups
|
||||
+explosion radius
|
||||
+dmg
|
||||
life steal
|
||||
ice bullets (reduce mob velocity on dmg)
|
||||
+bullet size
|
||||
get bonus ammo / reduced ammo use
|
||||
+reduced cs on fire (faster fire rate)
|
||||
orbiting orb fires at random targets
|
||||
missiles at random targets
|
||||
|
||||
have mob acceleration and look frequency scale with difficulty level
|
||||
this will speed up the responses of later mobs
|
||||
this should provide a feeling of difficulty without inflating the life of mobs
|
||||
@@ -46,15 +35,11 @@ game mechanics
|
||||
low friction ground
|
||||
bouncy ground
|
||||
|
||||
give each foot a sensor to check for ground collisions
|
||||
feet with not go into the ground even on slanted ground
|
||||
this might be not worth it, but it might look really cool
|
||||
|
||||
track foot positions with velocity better as the player walks/crouch/runs
|
||||
|
||||
add bullet on damage effects
|
||||
effects could:
|
||||
add to the array mod.do new mob behaviors
|
||||
add to the array mob.do new mob behaviors
|
||||
add a damage over time
|
||||
add a freeze
|
||||
change mob traits
|
||||
@@ -75,10 +60,6 @@ add bullet on damage effects
|
||||
remove standing on player actions
|
||||
replace with check if player feet are in an area.
|
||||
|
||||
unused ideas
|
||||
passive: walk through blocks (difficult to implement)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ const level = {
|
||||
document.title = "n-gon";
|
||||
this.intro(); //starting level
|
||||
// b.giveGuns(0) // set a starting gun for testing
|
||||
// mech.fieldUpgrades[5]() //give a field power up for testing
|
||||
mech.fieldUpgrades[6]() //give a field power up for testing
|
||||
// game.levelsCleared = 3; //for testing to simulate possible mobs spawns
|
||||
// this.bosses();
|
||||
// this.testingMap();
|
||||
|
||||
10
js/mobs.js
10
js/mobs.js
@@ -98,10 +98,12 @@ const mobs = {
|
||||
},
|
||||
seePlayerFreq: 20 + Math.round(Math.random() * 20), //how often NPC checks to see where player is, lower numbers have better vision
|
||||
foundPlayer() {
|
||||
this.locatePlayer();
|
||||
if (!this.seePlayer.yes) {
|
||||
this.alertNearByMobs();
|
||||
this.seePlayer.yes = true;
|
||||
if (!mech.isStealth) {
|
||||
this.locatePlayer();
|
||||
if (!this.seePlayer.yes) {
|
||||
this.alertNearByMobs();
|
||||
this.seePlayer.yes = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
lostPlayer() {
|
||||
|
||||
45
js/player.js
45
js/player.js
@@ -470,6 +470,7 @@ const mech = {
|
||||
index: 0
|
||||
},
|
||||
isHolding: false,
|
||||
isStealth: false,
|
||||
throwCharge: 0,
|
||||
fireCDcycle: 0,
|
||||
fieldCDcycle: 0,
|
||||
@@ -493,6 +494,7 @@ const mech = {
|
||||
this.fieldMeter = 1;
|
||||
this.fieldRegen = 0.0015;
|
||||
this.fieldCDcycle = 0;
|
||||
this.isStealth = false;
|
||||
this.holdingMassScale = 0.5;
|
||||
this.throwChargeRate = 2;
|
||||
this.throwChargeMax = 50;
|
||||
@@ -1035,6 +1037,49 @@ const mech = {
|
||||
mech.drawFieldMeter()
|
||||
}
|
||||
},
|
||||
() => {
|
||||
mech.fieldMode = 6;
|
||||
game.makeTextLog("<strong style='font-size:30px;'>Metamaterial Refractive Optics</strong><br> (left mouse or space bar) <p>localized invisibility field</p>", 1000);
|
||||
mech.setHoldDefaults();
|
||||
mech.fieldArc = 1; //field covers full 360 degrees
|
||||
mech.calculateFieldThreshold();
|
||||
|
||||
mech.hold = function () {
|
||||
mech.isStealth = false //isStealth is checked in mob foundPlayer()
|
||||
|
||||
if (mech.isHolding) {
|
||||
mech.drawHold(mech.holdingTarget);
|
||||
mech.holding();
|
||||
mech.throw();
|
||||
} else if ((keys[32] || game.mouseDownRight) && mech.fieldCDcycle < game.cycle) {
|
||||
const DRAIN = 0.0015 //mech.fieldRegen = 0.0015
|
||||
if (mech.fieldMeter > DRAIN) {
|
||||
mech.fieldMeter -= DRAIN;
|
||||
mech.isStealth = true //isStealth is checked in mob foundPlayer()
|
||||
|
||||
//draw stealth field
|
||||
// ctx.fillStyle = "rgba(255,255,155,0.9)";
|
||||
// ctx.fillStyle = "rgba(255,255,255,1)";
|
||||
ctx.fill();
|
||||
ctx.beginPath();
|
||||
ctx.arc(mech.pos.x, mech.pos.y + 25, 110, 0, 2 * Math.PI);
|
||||
ctx.globalCompositeOperation = "destination-in";
|
||||
ctx.fill();
|
||||
ctx.globalCompositeOperation = "source-over";
|
||||
|
||||
mech.grabPowerUp();
|
||||
mech.lookForPickUp();
|
||||
} else {
|
||||
mech.fieldCDcycle = game.cycle + 120;
|
||||
}
|
||||
} else if (mech.holdingTarget && mech.fireCDcycle < game.cycle) { //holding, but field button is released
|
||||
mech.pickUp();
|
||||
} else {
|
||||
mech.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||
}
|
||||
mech.drawFieldMeter()
|
||||
}
|
||||
},
|
||||
// () => {
|
||||
// mech.fieldMode = 1;
|
||||
// game.makeTextLog("<h2>Time Dilation Field</h2><br><strong>active ability:</strong> hold left and right mouse to slow time<br><strong>passive bonus:</strong> +field regeneration", 1000); //<br><strong>passive bonus:</strong> can phase through blocks
|
||||
|
||||
Reference in New Issue
Block a user