inductive coupling

your build url can now be copied in the pause screen

mod: inductive coupling - 4 max health per power up, but limited to 44 max health per level (replaces crystalized armor)
mod: transceiver chip - use all the power ups left over at the end of a level
mod: catabolism - does a flat 5 damage to your health for 3 ammo  (was 2% of max health for 1 ammo)
This commit is contained in:
landgreen
2020-12-16 09:55:07 -08:00
parent 1f7d7217d3
commit 732b13d8a4
11 changed files with 204 additions and 136 deletions

View File

@@ -595,6 +595,9 @@ const game = {
}
}
if (mod.isEndLevelPowerUp) {
for (let i = 0; i < powerUp.length; i++) powerUp[i].effect();
}
powerUps.totalPowerUps = powerUp.length
let holdTarget; //if player is holding something this remembers it before it gets deleted
@@ -752,8 +755,31 @@ const game = {
//check for double crouch
//crouch playerHead.position.y - player.position.y = 9.7 //positive
//standing playerHead.position.y - player.position.y = -30 //negative
// mech.undoCrouch()
if (!mech.crouch && ((playerHead.position.y - player.position.y) > 0)) {
// mech.undoCrouch()
Matter.Body.translate(playerHead, {
x: 0,
y: 40
});
if ((playerHead.position.y - player.position.y) > 0) {
Matter.Body.translate(playerHead, {
x: 0,
y: 40
});
if ((playerHead.position.y - player.position.y) > 0) {
Matter.Body.translate(playerHead, {
x: 0,
y: 40
});
if ((playerHead.position.y - player.position.y) > 0) {
Matter.Body.translate(playerHead, {
x: 0,
y: 40
});
}
}
}
} else if (mech.crouch && ((playerHead.position.y - player.position.y) > 10)) {
Matter.Body.translate(playerHead, {
x: 0,
y: 40