flip-flop

tech: flip-flip - does nothing, except toggle on collisions
tech: NOR gate - when flip-flip is ON take 0 harm from collisions
tech: NAND gate - when flip-flip is ON do 55.5% damage
tech: transistor - when flip-flop is ON regen 22 energy/s, when OFF drain 3.1 energy /s
tech: shift registers - set flip-flop to ON with a new level
This commit is contained in:
landgreen
2021-02-28 08:03:47 -08:00
parent 542815478e
commit e3ef0f00e3
11 changed files with 252 additions and 181 deletions

View File

@@ -776,7 +776,14 @@ const simulation = {
//energy overfill
if (m.energy > m.maxEnergy) m.energy = m.maxEnergy + (m.energy - m.maxEnergy) * tech.overfillDrain //every second energy above max energy loses 25%
if (tech.isFlipFlopEnergy) {
if (tech.isFlipFlopOn) {
m.energy += 0.22;
} else {
m.energy -= 0.031;
if (m.energy < 0) m.energy = 0
}
}
if (m.pos.y > simulation.fallHeight) { // if 4000px deep
Matter.Body.setVelocity(player, {
x: 0,