Update flipflop.js
This commit is contained in:
parent
7c55edc462
commit
b90b6d90e5
|
|
@ -13,15 +13,18 @@ elements.flipflop = {
|
||||||
let Powerstate = pixel.powerst
|
let Powerstate = pixel.powerst
|
||||||
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]
|
||||||
Output.charge = 0
|
|
||||||
if (Powerstate == "true" && Input.charge > 0.9) {
|
if (isEmpty(Output.x,Output.y) == false && isEmpty(Input.x,Input.y)){
|
||||||
Powerstate == "false"
|
Output.charge = 0
|
||||||
pixel.color = "#CF300D"
|
if (Powerstate == "true" && Input.charge > 0.9) {
|
||||||
Output.charge = 0
|
Powerstate == "false"
|
||||||
} else if (Powerstate == false && Input.charge < 0.9) {
|
pixel.color = "#CF300D"
|
||||||
Powerstate == true
|
Output.charge = 0
|
||||||
pixel.color = "#94CF0D"
|
} else if (Powerstate == false && Input.charge < 0.9) {
|
||||||
Output.charge = 5
|
Powerstate == true
|
||||||
}
|
pixel.color = "#94CF0D"
|
||||||
|
Output.charge = 5
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue