added text on new mods, mines don't stick on flat ground anymore
This commit is contained in:
@@ -1057,9 +1057,7 @@ const b = {
|
|||||||
gun = options[Math.floor(Math.random() * options.length)]
|
gun = options[Math.floor(Math.random() * options.length)]
|
||||||
}
|
}
|
||||||
if (gun === "all") {
|
if (gun === "all") {
|
||||||
if (b.guns[b.activeGun].switchOff) b.guns[b.activeGun].switchOff(); //run code when switching away from a gun
|
|
||||||
b.activeGun = 0;
|
b.activeGun = 0;
|
||||||
if (b.guns[b.activeGun].switchOn) b.guns[b.activeGun].switchOn(); //run code when switching to a new gun
|
|
||||||
b.inventoryGun = 0;
|
b.inventoryGun = 0;
|
||||||
for (let i = 0; i < b.guns.length; i++) {
|
for (let i = 0; i < b.guns.length; i++) {
|
||||||
b.inventory[i] = i;
|
b.inventory[i] = i;
|
||||||
@@ -1069,7 +1067,6 @@ const b = {
|
|||||||
} else {
|
} else {
|
||||||
if (!b.guns[gun].have) b.inventory.push(gun);
|
if (!b.guns[gun].have) b.inventory.push(gun);
|
||||||
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun
|
if (b.activeGun === null) b.activeGun = gun //if no active gun switch to new gun
|
||||||
if (b.guns[b.activeGun].switchOn) b.guns[b.activeGun].switchOn(); //run code when switching to a new gun
|
|
||||||
b.guns[gun].have = true;
|
b.guns[gun].have = true;
|
||||||
b.guns[gun].ammo = b.guns[gun].ammoPack * ammoPacks;
|
b.guns[gun].ammo = b.guns[gun].ammoPack * ammoPacks;
|
||||||
}
|
}
|
||||||
@@ -1813,7 +1810,12 @@ const b = {
|
|||||||
for (let i = 0; i < collide.length; i++) {
|
for (let i = 0; i < collide.length; i++) {
|
||||||
if (collide[i].bodyA.collisionFilter.category === cat.map || collide[i].bodyB.collisionFilter.category === cat.map) {
|
if (collide[i].bodyA.collisionFilter.category === cat.map || collide[i].bodyB.collisionFilter.category === cat.map) {
|
||||||
this.seeFrom = Vector.add(this.position, Vector.mult(collide[i].normal, -20)) //find the location 20 pixels perpendicular to the map
|
this.seeFrom = Vector.add(this.position, Vector.mult(collide[i].normal, -20)) //find the location 20 pixels perpendicular to the map
|
||||||
Matter.Body.setStatic(this, true)
|
// console.log()
|
||||||
|
const angle = Matter.Vector.angle(collide[i].normal, {
|
||||||
|
x: 1,
|
||||||
|
y: 0
|
||||||
|
})
|
||||||
|
if (angle > -0.1) Matter.Body.setStatic(this, true)
|
||||||
this.arm();
|
this.arm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,9 +213,7 @@ const game = {
|
|||||||
},
|
},
|
||||||
switchGun() {
|
switchGun() {
|
||||||
if (b.modNoAmmo) b.modNoAmmo = 1 //this prevents hacking the mod by switching guns
|
if (b.modNoAmmo) b.modNoAmmo = 1 //this prevents hacking the mod by switching guns
|
||||||
// if (b.guns[b.activeGun].switchOff) b.guns[b.activeGun].switchOff(); //run code when switching away from a gun
|
|
||||||
b.activeGun = b.inventory[b.inventoryGun];
|
b.activeGun = b.inventory[b.inventoryGun];
|
||||||
// if (b.guns[b.activeGun].switchOn) b.guns[b.activeGun].switchOn(); //run code when switching to a new gun
|
|
||||||
game.updateGunHUD();
|
game.updateGunHUD();
|
||||||
game.boldActiveGunHUD();
|
game.boldActiveGunHUD();
|
||||||
// mech.drop();
|
// mech.drop();
|
||||||
@@ -437,7 +435,6 @@ const game = {
|
|||||||
b.guns[i].have = false;
|
b.guns[i].have = false;
|
||||||
if (b.guns[i].ammo != Infinity) b.guns[i].ammo = 0;
|
if (b.guns[i].ammo != Infinity) b.guns[i].ammo = 0;
|
||||||
}
|
}
|
||||||
// if (b.activeGun && b.guns[b.activeGun].switchOff) b.guns[b.activeGun].switchOff(); //run code when switching away from a gun
|
|
||||||
b.activeGun = null;
|
b.activeGun = null;
|
||||||
b.setModDefaults(); //remove mods
|
b.setModDefaults(); //remove mods
|
||||||
game.updateModHUD();
|
game.updateModHUD();
|
||||||
|
|||||||
@@ -4,16 +4,19 @@ const powerUps = {
|
|||||||
choose(type, index) {
|
choose(type, index) {
|
||||||
if (type === "gun") {
|
if (type === "gun") {
|
||||||
b.giveGuns(index)
|
b.giveGuns(index)
|
||||||
// game.replaceTextLog = true;
|
game.replaceTextLog = true;
|
||||||
// game.makeTextLog(`${game.SVGleftMouse} <strong style='font-size:30px;'>${b.guns[index].name}</strong><br><br>${b.guns[index].description}`, 500);
|
game.makeTextLog(`${game.SVGleftMouse} <strong style='font-size:30px;'>${b.guns[index].name}</strong><br><br>${b.guns[index].description}`, 500);
|
||||||
// game.replaceTextLog = false;
|
game.replaceTextLog = false;
|
||||||
} else if (type === "field") {
|
} else if (type === "field") {
|
||||||
mech.setField(index)
|
mech.setField(index)
|
||||||
|
game.replaceTextLog = true;
|
||||||
|
game.makeTextLog(`${game.SVGrightMouse}<strong style='font-size:30px;'> ${mech.fieldUpgrades[mech.fieldMode].name}</strong><br><span class='faded'></span><br>${mech.fieldUpgrades[mech.fieldMode].description}`, 600);
|
||||||
|
game.replaceTextLog = false;
|
||||||
} else if (type === "mod") {
|
} else if (type === "mod") {
|
||||||
b.giveMod(index)
|
b.giveMod(index)
|
||||||
// game.replaceTextLog = true;
|
game.replaceTextLog = true;
|
||||||
// game.makeTextLog(`<div class="circle mod"></div> <strong style='font-size:30px;'>${b.mods[index].name}</strong><br><br> ${b.mods[index].description}`, 500);
|
game.makeTextLog(`<div class="circle mod"></div> <strong style='font-size:30px;'>${b.mods[index].name}</strong><br><br> ${b.mods[index].description}`, 500);
|
||||||
// game.replaceTextLog = false;
|
game.replaceTextLog = false;
|
||||||
}
|
}
|
||||||
document.body.style.cursor = "none";
|
document.body.style.cursor = "none";
|
||||||
document.getElementById("choose-grid").style.display = "none"
|
document.getElementById("choose-grid").style.display = "none"
|
||||||
|
|||||||
Reference in New Issue
Block a user