diff --git a/js/game.js b/js/game.js
index 503cdcd..5e2c58f 100644
--- a/js/game.js
+++ b/js/game.js
@@ -612,7 +612,6 @@ const game = {
player.force.y += player.mass * game.g;
},
reset() { //run on first run, and each later run after you die
- game.isCheating = false
b.removeAllGuns();
mod.setupAllMods(); //sets mods to default values
b.setFireCD();
@@ -668,6 +667,7 @@ const game = {
document.getElementById("construct").style.display = 'none'
}
}
+ game.isCheating = false
},
firstRun: true,
splashReturn() {
diff --git a/js/index.js b/js/index.js
index 2c76f8f..d58dcea 100644
--- a/js/index.js
+++ b/js/index.js
@@ -477,6 +477,7 @@ if (localSettings) {
difficultyMode: '1',
fpsCapDefault: 'max',
runCount: 0,
+ levelsClearedLastGame: 0
};
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
document.getElementById("community-maps").checked = localSettings.isCommunityMaps
@@ -617,6 +618,7 @@ document.getElementById("community-maps").addEventListener("input", () => {
document.getElementById("difficulty-select").addEventListener("input", () => {
game.difficultyMode = Number(document.getElementById("difficulty-select").value)
localSettings.difficultyMode = game.difficultyMode
+ localSettings.levelsClearedLastGame = 0 //after changing difficulty, reset run history
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
});
diff --git a/js/level.js b/js/level.js
index 9d9c131..eccc23a 100644
--- a/js/level.js
+++ b/js/level.js
@@ -35,12 +35,15 @@ const level = {
// level.newLevel() //fan level
// level.basement(); //fan level
// level.stronghold() //fan level
+
+
} else {
spawn.setSpawnList(); //picks a couple mobs types for a themed random mob spawns
// spawn.pickList = ["focuser", "focuser"]
level[level.levels[level.onLevel]](); //picks the current map from the the levels array
if (!game.isCheating) {
localSettings.runCount += level.levelsCleared //track the number of total runs locally
+ localSettings.levelsClearedLastGame = level.levelsCleared
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
}
}
@@ -3166,7 +3169,7 @@ const level = {
difficultyIncrease(num = 1) {
for (let i = 0; i < num; i++) {
game.difficulty++
- game.dmgScale += 0.35; //damage done by mobs increases each level
+ game.dmgScale += 0.37; //damage done by mobs increases each level
b.dmgScale *= 0.92; //damage done by player decreases each level
if (game.accelScale < 5) game.accelScale *= 1.027 //mob acceleration increases each level
if (game.lookFreqScale > 0.2) game.lookFreqScale *= 0.975 //mob cycles between looks decreases each level
@@ -3177,7 +3180,7 @@ const level = {
difficultyDecrease(num = 1) { //used in easy mode for game.reset()
for (let i = 0; i < num; i++) {
game.difficulty--
- game.dmgScale -= 0.35; //damage done by mobs increases each level
+ game.dmgScale -= 0.37; //damage done by mobs increases each level
if (game.dmgScale < 0.1) game.dmgScale = 0.1;
b.dmgScale /= 0.92; //damage done by player decreases each level
if (game.accelScale > 0.2) game.accelScale /= 1.027 //mob acceleration increases each level
diff --git a/js/mods.js b/js/mods.js
index fe2be5c..2dddce2 100644
--- a/js/mods.js
+++ b/js/mods.js
@@ -1029,7 +1029,7 @@ const mod = {
},
{
name: "Bayesian statistics",
- description: "25% chance to duplicate spawned power ups
after a collision, eject one of your mods",
+ description: "20% chance to duplicate spawned power ups
after a collision, eject one of your mods",
maxCount: 1,
count: 0,
allowed() {
diff --git a/js/player.js b/js/player.js
index 566532f..dddd6f9 100644
--- a/js/player.js
+++ b/js/player.js
@@ -65,7 +65,7 @@ const mech = {
light: 100,
},
setFillColors() {
- console.log(mech.color)
+ // console.log(mech.color)
this.fillColor = `hsl(${mech.color.hue},${mech.color.sat}%,${mech.color.light}%)`
this.fillColorDark = `hsl(${mech.color.hue},${mech.color.sat}%,${mech.color.light-20}%)`
},
diff --git a/js/powerup.js b/js/powerup.js
index 65fdc3e..4d6721b 100644
--- a/js/powerup.js
+++ b/js/powerup.js
@@ -499,6 +499,15 @@ const powerUps = {
},
spawnStartingPowerUps(x, y) { //used for map specific power ups, mostly to give player a starting gun
if (level.levelsCleared < 4) { //runs 4 times on all difficulty levels
+
+ //bonus power ups for clearing runs in the last game
+ if (level.levelsCleared === 0 && !game.isCheating) {
+ for (let i = 0; i < localSettings.levelsClearedLastGame / 5 - 1; i++) {
+ powerUps.spawn(x, y, "mod", false); //spawn a mod for every 5 levels cleared in last game
+ }
+ localSettings.levelsClearedLastGame = 0 //after getting bonus power ups reset run history
+ localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
+ }
if (b.inventory.length === 0) {
powerUps.spawn(x, y, "gun", false); //first gun
} else if (mod.totalCount === 0) { //first mod
@@ -560,7 +569,7 @@ const powerUps = {
!(mod.isEnergyNoAmmo && target === 'ammo')
) {
powerUps.directSpawn(x, y, target, moving, mode)
- if (mod.isBayesian && Math.random() < 0.3) powerUps.directSpawn(x, y, target, moving, mode)
+ if (mod.isBayesian && Math.random() < 0.2) powerUps.directSpawn(x, y, target, moving, mode)
}
},
};
\ No newline at end of file
diff --git a/todo.txt b/todo.txt
index 93bdbfb..bf1dd82 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,9 +1,3 @@
-blocks drift towards the center of pilot wave's field
-
-mod: Bayesian statistics - no longer stops ammo spawns
- 30% to double power ups, but ejects a mod when you take damage
-
-mod: exciton-lattice - 40% damage, but no ammo can spawn
************** TODO - n-gon **************