added colors to custom grid select
added random laser boss positions
This commit is contained in:
18
js/index.js
18
js/index.js
@@ -68,7 +68,7 @@ const build = {
|
||||
for (let i = 0, len = b.inventory.length; i < len; i++) { //look for selection in inventory
|
||||
if (b.guns[b.inventory[i]].name === b.guns[index].name) { //if already clicked, remove gun
|
||||
isDeselect = true
|
||||
who.classList.remove("build-grid-selected");
|
||||
who.classList.remove("build-gun-selected");
|
||||
//remove gun
|
||||
b.inventory.splice(i, 1)
|
||||
b.guns[index].count = 0;
|
||||
@@ -79,24 +79,24 @@ const build = {
|
||||
}
|
||||
}
|
||||
if (!isDeselect) { //add gun
|
||||
who.classList.add("build-grid-selected");
|
||||
who.classList.add("build-gun-selected");
|
||||
b.giveGuns(index)
|
||||
}
|
||||
} else if (type === "field") {
|
||||
if (mech.fieldMode !== index) {
|
||||
document.getElementById("field-" + mech.fieldMode).classList.remove("build-grid-selected");
|
||||
document.getElementById("field-" + mech.fieldMode).classList.remove("build-field-selected");
|
||||
mech.setField(index)
|
||||
who.classList.add("build-grid-selected");
|
||||
who.classList.add("build-field-selected");
|
||||
}
|
||||
} else if (type === "mod") { //remove mod if you have too many
|
||||
if (b.mods[index].count < b.mods[index].maxCount) {
|
||||
if (!who.classList.contains("build-grid-selected")) who.classList.add("build-grid-selected");
|
||||
if (!who.classList.contains("build-mod-selected")) who.classList.add("build-mod-selected");
|
||||
b.giveMod(index)
|
||||
// if (b.mods[index].count > 1) who.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[index].name} (${b.mods[index].count}x)</div> ${b.mods[index].description}`
|
||||
} else {
|
||||
b.removeMod(index);
|
||||
// who.innerHTML = `<div class="grid-title"><div class="circle-grid mod"></div> ${b.mods[index].name}</div> ${b.mods[index].description}`
|
||||
who.classList.remove("build-grid-selected");
|
||||
who.classList.remove("build-mod-selected");
|
||||
}
|
||||
}
|
||||
//update mod text //disable not allowed mods
|
||||
@@ -123,8 +123,8 @@ const build = {
|
||||
if (b.mods[i].count > 0) {
|
||||
b.removeMod(i)
|
||||
}
|
||||
if (modID.classList.contains("build-grid-selected")) {
|
||||
modID.classList.remove("build-grid-selected");
|
||||
if (modID.classList.contains("build-mod-selected")) {
|
||||
modID.classList.remove("build-mod-selected");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ const build = {
|
||||
b.setupAllMods();
|
||||
build.isCustomSelection = true;
|
||||
build.populateGrid();
|
||||
document.getElementById("field-0").classList.add("build-grid-selected");
|
||||
document.getElementById("field-0").classList.add("build-field-selected");
|
||||
document.getElementById("build-grid").style.display = "grid"
|
||||
},
|
||||
|
||||
|
||||
18
js/level.js
18
js/level.js
@@ -13,7 +13,7 @@ const level = {
|
||||
levelsCleared: 0,
|
||||
start() {
|
||||
if (level.levelsCleared === 0) {
|
||||
// level.difficultyIncrease(5)
|
||||
// level.difficultyIncrease(4)
|
||||
// b.giveGuns("laser")
|
||||
// mech.setField("negative mass field")
|
||||
// for (let i = 0; i < 9; i++) {
|
||||
@@ -448,6 +448,8 @@ const level = {
|
||||
spawn.mapRect(-500, -1900, 400, 50); //super high shade
|
||||
spawn.mapRect(0, -1900, 400, 50); //super high shade
|
||||
spawn.mapRect(-150, -1350, 200, 25); //super high shade
|
||||
spawn.bodyRect(140, -2100, 150, 200); //shield from laser
|
||||
|
||||
level.fillBG.push({
|
||||
x: -300,
|
||||
y: -1900,
|
||||
@@ -563,9 +565,17 @@ const level = {
|
||||
spawn.randomBoss(2700, -1600, 0.1);
|
||||
spawn.randomBoss(1600, -100, 0);
|
||||
spawn.randomBoss(5000, -3900, -0.3);
|
||||
// spawn.laserBoss(2750, -2600);
|
||||
if (game.difficulty > 3) spawn.laserBoss(3050, -2850);
|
||||
|
||||
if (game.difficulty > 3) {
|
||||
if (Math.random() < 0.25) {
|
||||
spawn.laserBoss(2900 + 300 * Math.random(), -2950 + 150 * Math.random());
|
||||
} else if (Math.random() < 0.33) {
|
||||
spawn.laserBoss(1800 + 250 * Math.random(), -2600 + 150 * Math.random());
|
||||
} else if (Math.random() < 0.5) {
|
||||
spawn.laserBoss(3500 + 250 * Math.random(), -2600 + 1000 * Math.random());
|
||||
} else {
|
||||
spawn.laserBoss(600 + 200 * Math.random(), -2150 + 250 * Math.random());
|
||||
}
|
||||
}
|
||||
},
|
||||
rooftops() {
|
||||
level.defaultZoom = 1700
|
||||
|
||||
@@ -130,7 +130,7 @@ const powerUps = {
|
||||
},
|
||||
mod: {
|
||||
name: "mod",
|
||||
color: "#a8f",
|
||||
color: "hsl(246,100%,77%)", //"#a8f",
|
||||
size() {
|
||||
return 42;
|
||||
},
|
||||
|
||||
29
style.css
29
style.css
@@ -214,12 +214,28 @@ summary {
|
||||
background-color: #efeff5;
|
||||
}
|
||||
|
||||
.build-grid-selected {
|
||||
background-color: #76808d;
|
||||
.build-field-selected {
|
||||
background-color: hsl(193, 100%, 75%);
|
||||
}
|
||||
|
||||
.build-grid-selected:hover {
|
||||
background-color: #76808d;
|
||||
.build-field-selected:hover {
|
||||
background-color: hsl(193, 100%, 68%);
|
||||
}
|
||||
|
||||
.build-gun-selected {
|
||||
background-color: hsl(218, 100%, 81%);
|
||||
}
|
||||
|
||||
.build-gun-selected:hover {
|
||||
background-color: hsl(218, 100%, 76%);
|
||||
}
|
||||
|
||||
.build-mod-selected {
|
||||
background-color: hsl(247, 100%, 84%);
|
||||
}
|
||||
|
||||
.build-mod-selected:hover {
|
||||
background-color: hsl(247, 100%, 81%);
|
||||
}
|
||||
|
||||
.build-grid-disabled {
|
||||
@@ -412,7 +428,7 @@ em {
|
||||
}
|
||||
|
||||
.color-m {
|
||||
color: rgb(115, 61, 202);
|
||||
color: hsl(246, 57%, 52%);
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
@@ -442,7 +458,8 @@ em {
|
||||
}
|
||||
|
||||
.mod {
|
||||
background: #96e;
|
||||
/* background: rgb(116, 102, 238); */
|
||||
background: hsl(246, 80%, 67%);
|
||||
}
|
||||
|
||||
.grey {
|
||||
|
||||
17
todo.txt
17
todo.txt
@@ -1,10 +1,5 @@
|
||||
************** TODO - n-gon **************
|
||||
|
||||
randomize boss laser spawn locations
|
||||
|
||||
consider making jumping cost energy (like stamina)
|
||||
should walking cost energy too?
|
||||
|
||||
mod - nano-scale field makes spores instead of drones
|
||||
|
||||
mod - mines - fire something instead of needles on activation
|
||||
@@ -21,11 +16,15 @@ lore - a robot (the player) gains self awareness
|
||||
final mod is "this is just a simulation"
|
||||
you get immortality and Infinity damage
|
||||
the next level is the final level
|
||||
atmosphere levels that explore lore
|
||||
give the user a rest, between combat
|
||||
low combat more graphics
|
||||
|
||||
atmosphere levels: change the pace, give the user a rest between combat
|
||||
low or no combat, but more graphics
|
||||
explore lore
|
||||
add text for player thoughts?
|
||||
simple puzzles
|
||||
cool looking stuff
|
||||
large rotating fan that the player has to move through
|
||||
nonaggressive mobs one mob attacking the passive mobs
|
||||
nonaggressive mobs
|
||||
in the final level you see your self at the starting level, with the wires
|
||||
you shoot your self to wake up?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user