Update flipflop.js
This commit is contained in:
parent
bc7b828c73
commit
94814ba92c
|
|
@ -10,19 +10,20 @@ elements.flipflop = {
|
|||
doHeat(pixel)
|
||||
doBurning(pixel)
|
||||
doElectricity(pixel)
|
||||
|
||||
console.log(pixel.powerstate)
|
||||
let Output = pixelMap[pixel.x+1][pixel.y]
|
||||
let Input = pixelMap[pixel.x-1][pixel.y]
|
||||
if (typeof Output !== "undefined" && typeof Input !== "undefined") {
|
||||
if (Input.charge > 0.45) {
|
||||
if (Inpput.charge == 0.75) {
|
||||
conso le.log(Input.charge)
|
||||
if (pixel.powerstate == "true") {
|
||||
pixel.powerstate = "false"
|
||||
pixel.color = "#CF300D"
|
||||
Output.charge = 0
|
||||
} else if (pixel.powerstate == "true") {
|
||||
pixel.powerstate = "true"
|
||||
pixel.color = "#94CF0D"
|
||||
Output.charge = 1
|
||||
pixel.color = "#CF300D"
|
||||
Output.charge = 0
|
||||
} else if (pixel.powerstate == "false") {
|
||||
pixel.powerstate = "true"
|
||||
pixel.color = "#94CF0D"
|
||||
Output.charge = 1
|
||||
}
|
||||
} else {
|
||||
Output.charge = 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue