added option for community maps
This commit is contained in:
@@ -103,6 +103,9 @@
|
|||||||
<option value="4">why...</option>
|
<option value="4">why...</option>
|
||||||
</select>
|
</select>
|
||||||
<br>
|
<br>
|
||||||
|
<label for="community-maps" title="adds in new maps made by other playrs">include community maps:</label>
|
||||||
|
<input type="checkbox" id="community-maps" name="community-maps" style="width:17px; height:17px;">
|
||||||
|
<br>
|
||||||
<label for="body-damage" title="allow damage from the ground and large fast moving blocks">collision damage from blocks:</label>
|
<label for="body-damage" title="allow damage from the ground and large fast moving blocks">collision damage from blocks:</label>
|
||||||
<input type="checkbox" id="body-damage" name="body-damage" checked style="width:17px; height:17px;">
|
<input type="checkbox" id="body-damage" name="body-damage" checked style="width:17px; height:17px;">
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ const b = {
|
|||||||
isModAlphaRadiation: null,
|
isModAlphaRadiation: null,
|
||||||
modEnergyRegen: null,
|
modEnergyRegen: null,
|
||||||
isModVacuumShield: null,
|
isModVacuumShield: null,
|
||||||
|
modRenormalization: null,
|
||||||
|
modGrenadeFragments: null,
|
||||||
modOnHealthChange() { //used with acid mod
|
modOnHealthChange() { //used with acid mod
|
||||||
if (b.isModAcidDmg && mech.health > 0.8) {
|
if (b.isModAcidDmg && mech.health > 0.8) {
|
||||||
b.modAcidDmg = 0.7
|
b.modAcidDmg = 0.7
|
||||||
@@ -1334,6 +1336,22 @@ const b = {
|
|||||||
b.isModIceField = false;
|
b.isModIceField = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "renormalization",
|
||||||
|
description: "<strong>phase decoherence field</strong> has <strong>3x visibility</strong><br>and <strong>1/3</strong> <strong class='color-f'>energy</strong> drain when <strong>firing</strong>",
|
||||||
|
maxCount: 1,
|
||||||
|
count: 0,
|
||||||
|
allowed() {
|
||||||
|
return mech.fieldUpgrades[mech.fieldMode].name === "phase decoherence field"
|
||||||
|
},
|
||||||
|
requires: "phase decoherence field",
|
||||||
|
effect() {
|
||||||
|
b.modRenormalization = 3;
|
||||||
|
},
|
||||||
|
remove() {
|
||||||
|
b.modRenormalization = 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "quantum dissipation",
|
name: "quantum dissipation",
|
||||||
description: "<strong>phase decoherence field</strong> uses <strong class='color-f'>energy</strong> to <br><strong class='color-d'>damage</strong> unshielded <strong>mobs</strong> that you <strong>overlap</strong>",
|
description: "<strong>phase decoherence field</strong> uses <strong class='color-f'>energy</strong> to <br><strong class='color-d'>damage</strong> unshielded <strong>mobs</strong> that you <strong>overlap</strong>",
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ const game = {
|
|||||||
fpsCap: null, //limits frames per second to 144/2=72, on most monitors the fps is capped at 60fps by the hardware
|
fpsCap: null, //limits frames per second to 144/2=72, on most monitors the fps is capped at 60fps by the hardware
|
||||||
fpsCapDefault: 72, //use to change fpsCap back to normal after a hit from a mob
|
fpsCapDefault: 72, //use to change fpsCap back to normal after a hit from a mob
|
||||||
isEasyToAimMode: true, //removes power ups that don't work well with a track pad
|
isEasyToAimMode: true, //removes power ups that don't work well with a track pad
|
||||||
|
isCommunityMaps: false,
|
||||||
cyclePaused: 0,
|
cyclePaused: 0,
|
||||||
fallHeight: 3000, //below this y position the player dies
|
fallHeight: 3000, //below this y position the player dies
|
||||||
lastTimeStamp: 0, //tracks time stamps for measuring delta
|
lastTimeStamp: 0, //tracks time stamps for measuring delta
|
||||||
@@ -597,9 +598,10 @@ const game = {
|
|||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
if (game.isCommunityMaps) level.levels.push("stronghold");
|
||||||
level.levels = shuffle(level.levels); //shuffles order of maps
|
level.levels = shuffle(level.levels); //shuffles order of maps
|
||||||
level.levels.unshift("bosses"); //add bosses level to the end of the randomized levels list
|
level.levels.unshift("bosses"); //add bosses level to the end of the randomized levels list
|
||||||
|
console.log(level.levels)
|
||||||
}
|
}
|
||||||
game.reset();
|
game.reset();
|
||||||
game.firstRun = false;
|
game.firstRun = false;
|
||||||
|
|||||||
12
js/index.js
12
js/index.js
@@ -380,6 +380,9 @@ if (localSettings) {
|
|||||||
game.isEasyToAimMode = localSettings.isEasyToAimMode
|
game.isEasyToAimMode = localSettings.isEasyToAimMode
|
||||||
document.getElementById("track-pad-mode").checked = localSettings.isEasyToAimMode
|
document.getElementById("track-pad-mode").checked = localSettings.isEasyToAimMode
|
||||||
|
|
||||||
|
game.isCommunityMaps = localSettings.isCommunityMaps
|
||||||
|
document.getElementById("community-maps").checked = localSettings.isCommunityMaps
|
||||||
|
|
||||||
game.difficultyMode = localSettings.difficultyMode
|
game.difficultyMode = localSettings.difficultyMode
|
||||||
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
||||||
|
|
||||||
@@ -393,6 +396,7 @@ if (localSettings) {
|
|||||||
localSettings = {
|
localSettings = {
|
||||||
isBodyDamage: true,
|
isBodyDamage: true,
|
||||||
isEasyToAimMode: false,
|
isEasyToAimMode: false,
|
||||||
|
isCommunityMaps: false,
|
||||||
difficultyMode: '1',
|
difficultyMode: '1',
|
||||||
fpsCapDefault: 'max',
|
fpsCapDefault: 'max',
|
||||||
};
|
};
|
||||||
@@ -400,6 +404,8 @@ if (localSettings) {
|
|||||||
document.getElementById("body-damage").checked = localSettings.isBodyDamage
|
document.getElementById("body-damage").checked = localSettings.isBodyDamage
|
||||||
document.getElementById("track-pad-mode").checked = localSettings.isEasyToAimMode
|
document.getElementById("track-pad-mode").checked = localSettings.isEasyToAimMode
|
||||||
game.isEasyToAimMode = localSettings.isEasyToAimMode
|
game.isEasyToAimMode = localSettings.isEasyToAimMode
|
||||||
|
document.getElementById("community-maps").checked = localSettings.isEasyToAimMode
|
||||||
|
game.isCommunityMaps = localSettings.isCommunityMaps
|
||||||
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
document.getElementById("difficulty-select").value = localSettings.difficultyMode
|
||||||
document.getElementById("fps-select").value = localSettings.fpsCapDefault
|
document.getElementById("fps-select").value = localSettings.fpsCapDefault
|
||||||
}
|
}
|
||||||
@@ -503,6 +509,12 @@ document.getElementById("track-pad-mode").addEventListener("input", () => {
|
|||||||
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.getElementById("community-maps").addEventListener("input", () => {
|
||||||
|
game.isCommunityMaps = document.getElementById("community-maps").checked
|
||||||
|
localSettings.isCommunityMaps = game.isCommunityMaps
|
||||||
|
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
|
||||||
|
});
|
||||||
|
|
||||||
// difficulty-select-custom event listener is set in build.makeGrid
|
// difficulty-select-custom event listener is set in build.makeGrid
|
||||||
document.getElementById("difficulty-select").addEventListener("input", () => {
|
document.getElementById("difficulty-select").addEventListener("input", () => {
|
||||||
game.difficultyMode = Number(document.getElementById("difficulty-select").value)
|
game.difficultyMode = Number(document.getElementById("difficulty-select").value)
|
||||||
|
|||||||
21
js/player.js
21
js/player.js
@@ -1751,17 +1751,16 @@ const mech = {
|
|||||||
isEasyToAim: true,
|
isEasyToAim: true,
|
||||||
effect: () => {
|
effect: () => {
|
||||||
mech.fieldFire = true;
|
mech.fieldFire = true;
|
||||||
mech.fieldMeterColor = "#fff"
|
mech.fieldMeterColor = "#fff";
|
||||||
mech.fieldPhase = 0
|
mech.fieldPhase = 0;
|
||||||
|
|
||||||
mech.hold = function () {
|
mech.hold = function () {
|
||||||
function drawField(radius) {
|
function drawField(radius) {
|
||||||
radius *= 0.7 + 0.7 * mech.energy
|
radius *= 0.6 + 0.7 * mech.energy * b.modRenormalization;
|
||||||
const rotate = mech.cycle * 0.005
|
const rotate = mech.cycle * 0.005;
|
||||||
const amplitude = 0.06
|
mech.fieldPhase += 0.5 - 0.5 * Math.sqrt(Math.min(mech.energy, 1));
|
||||||
mech.fieldPhase += 0.5 - 0.5 * Math.sqrt(Math.min(mech.energy, 1))
|
const off1 = 1 + 0.06 * Math.sin(mech.fieldPhase);
|
||||||
const off1 = 1 + amplitude * Math.sin(mech.fieldPhase) //+ 0.07 * Math.sin(mech.cycle * 0.05)
|
const off2 = 1 - 0.06 * Math.sin(mech.fieldPhase);
|
||||||
const off2 = 1 - amplitude * Math.sin(mech.fieldPhase) //+ 0.07 * Math.sin(mech.cycle * 0.05)
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.ellipse(mech.pos.x, mech.pos.y, radius * off1, radius * off2, rotate, 0, 2 * Math.PI);
|
ctx.ellipse(mech.pos.x, mech.pos.y, radius * off1, radius * off2, rotate, 0, 2 * Math.PI);
|
||||||
ctx.fillStyle = "#fff" //`rgba(0,0,0,${0.5+0.5*mech.energy})`;
|
ctx.fillStyle = "#fff" //`rgba(0,0,0,${0.5+0.5*mech.energy})`;
|
||||||
@@ -1770,7 +1769,7 @@ const mech = {
|
|||||||
ctx.globalCompositeOperation = "source-over";
|
ctx.globalCompositeOperation = "source-over";
|
||||||
ctx.clip();
|
ctx.clip();
|
||||||
|
|
||||||
if (mech.fireCDcycle > mech.cycle) {
|
if (mech.fireCDcycle > mech.cycle && (keys[32] || game.mouseDownRight)) {
|
||||||
ctx.lineWidth = 5;
|
ctx.lineWidth = 5;
|
||||||
ctx.strokeStyle = `rgba(0, 204, 255,1)`
|
ctx.strokeStyle = `rgba(0, 204, 255,1)`
|
||||||
ctx.stroke()
|
ctx.stroke()
|
||||||
@@ -1788,7 +1787,7 @@ const mech = {
|
|||||||
mech.grabPowerUp();
|
mech.grabPowerUp();
|
||||||
mech.lookForPickUp();
|
mech.lookForPickUp();
|
||||||
|
|
||||||
const DRAIN = (0.0005 + 0.0001 * player.speed) * (mech.fireCDcycle > mech.cycle ? 4 : 1) //game.mouseDown
|
const DRAIN = (0.0005 + 0.0001 * player.speed) * (mech.fireCDcycle > mech.cycle ? 10 / b.modRenormalization : 1) //game.mouseDown
|
||||||
if (mech.energy > DRAIN) {
|
if (mech.energy > DRAIN) {
|
||||||
mech.energy -= DRAIN;
|
mech.energy -= DRAIN;
|
||||||
if (mech.energy < 0.001) {
|
if (mech.energy < 0.001) {
|
||||||
@@ -1842,7 +1841,7 @@ const mech = {
|
|||||||
} else {
|
} else {
|
||||||
// this.fieldRange = 3000
|
// this.fieldRange = 3000
|
||||||
if (this.fieldRange < 2000 && mech.holdingTarget === null) {
|
if (this.fieldRange < 2000 && mech.holdingTarget === null) {
|
||||||
this.fieldRange += 200
|
this.fieldRange += 20
|
||||||
drawField(this.fieldRange)
|
drawField(this.fieldRange)
|
||||||
}
|
}
|
||||||
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.holdingTarget = null; //clears holding target (this is so you only pick up right after the field button is released and a hold target exists)
|
||||||
|
|||||||
15
todo.txt
15
todo.txt
@@ -1,12 +1,8 @@
|
|||||||
|
|
||||||
phase decoherence field - updated graphics, can fire gun while active
|
|
||||||
mod - fragmentation grenade fires nails
|
|
||||||
|
|
||||||
************** TODO - n-gon **************
|
************** TODO - n-gon **************
|
||||||
|
|
||||||
pulse and time dilation only ones left with no dedicated mod
|
pulse and time dilation only ones left with no dedicated mod
|
||||||
|
|
||||||
mod - renormalization: you can shoot bullets while in phase field
|
mod - renormalization: phase decoherence field has more range and less energy cost
|
||||||
|
|
||||||
lore - a robot (the player) gains self awareness
|
lore - a robot (the player) gains self awareness
|
||||||
each mod/gun/field is a new tech
|
each mod/gun/field is a new tech
|
||||||
@@ -35,15 +31,6 @@ work on burn status effect
|
|||||||
graphics don't look right
|
graphics don't look right
|
||||||
how is it different from the chemical dot
|
how is it different from the chemical dot
|
||||||
|
|
||||||
perfect diamagnetism should get larger as it blocks more, and then slowly fade back to the normal size
|
|
||||||
|
|
||||||
gun - bullets that acts like drones but only last for 2 seconds and do more damage
|
|
||||||
|
|
||||||
field - the basic field emitter, but no energy loss and no knock back on blocks
|
|
||||||
this field should make blocking a viable strategy
|
|
||||||
gain energy on blocking?
|
|
||||||
call it diamagnetic field and remove the diamagnetism mod?
|
|
||||||
|
|
||||||
mod - nails do poison damage
|
mod - nails do poison damage
|
||||||
|
|
||||||
mod - increase laser bot range, and reduce energy drain
|
mod - increase laser bot range, and reduce energy drain
|
||||||
|
|||||||
Reference in New Issue
Block a user