Update flipflop.js
This commit is contained in:
parent
89b75ae78e
commit
a9fb0f1918
|
|
@ -1,7 +1,9 @@
|
||||||
elements.flipflop = {
|
elements.flipflop = {
|
||||||
properties: {
|
properties: {
|
||||||
powerstate: "false",
|
powerstate: "false",
|
||||||
|
cooldown: "0"
|
||||||
},
|
},
|
||||||
|
if (pixel.cooldown > 0)
|
||||||
name: "Flip Flop",
|
name: "Flip Flop",
|
||||||
color: "#CF300D",
|
color: "#CF300D",
|
||||||
state: "solid",
|
state: "solid",
|
||||||
|
|
@ -10,11 +12,15 @@ elements.flipflop = {
|
||||||
doHeat(pixel)
|
doHeat(pixel)
|
||||||
doBurning(pixel)
|
doBurning(pixel)
|
||||||
doElectricity(pixel)
|
doElectricity(pixel)
|
||||||
|
|
||||||
let Output = pixelMap[pixel.x+1][pixel.y]
|
let Output = pixelMap[pixel.x+1][pixel.y]
|
||||||
let Input = pixelMap[pixel.x-1][pixel.y]
|
let Input = pixelMap[pixel.x-1][pixel.y]
|
||||||
console.log(pixel.powerstate)
|
console.log(pixel.powerstate)
|
||||||
if (typeof Output !== "undefined" && typeof Input !== "undefined"){
|
if (typeof Output !== "undefined" && typeof Input !== "undefined"){
|
||||||
|
if (pixel.cooldown > 0){
|
||||||
|
Input.charge=0
|
||||||
|
pixel.cooldown--
|
||||||
|
}
|
||||||
Output.charge = 0
|
Output.charge = 0
|
||||||
if (pixel.powerstate == "true" && Input.charge > 0.2) {
|
if (pixel.powerstate == "true" && Input.charge > 0.2) {
|
||||||
Input.charge = 0
|
Input.charge = 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue