Update flipflop.js
This commit is contained in:
parent
a8999ba4dc
commit
0e9b52edc5
|
|
@ -6,7 +6,6 @@ elements.flipflop = {
|
||||||
color: "#CF300D",
|
color: "#CF300D",
|
||||||
state: "solid",
|
state: "solid",
|
||||||
category: "machines",
|
category: "machines",
|
||||||
conduct: 1,
|
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
doHeat(pixel)
|
doHeat(pixel)
|
||||||
doBurning(pixel)
|
doBurning(pixel)
|
||||||
|
|
@ -17,12 +16,12 @@ elements.flipflop = {
|
||||||
console.log(pixel.powerstate)
|
console.log(pixel.powerstate)
|
||||||
if (typeof Output !== "undefined" && typeof Input !== "undefined"){
|
if (typeof Output !== "undefined" && typeof Input !== "undefined"){
|
||||||
Output.charge = 0
|
Output.charge = 0
|
||||||
if (pixel.powerstate == "true" && pixel.charge > 0.2) {
|
if (pixel.powerstate == "true" && Input.charge > 0.2) {
|
||||||
pixel.powerstate = "false"
|
pixel.powerstate = "false"
|
||||||
pixel.color = "#CF300D"
|
pixel.color = "#CF300D"
|
||||||
console.log(pixel.powerstate+"y")
|
console.log(pixel.powerstate+"y")
|
||||||
Output.charge = 0
|
Output.charge = 0
|
||||||
} else if (pixel.powerstate == "false" && pixel.charge > 0.2) {
|
} else if (pixel.powerstate == "false" && Input.charge > 0.2) {
|
||||||
pixel.powerstate = "true"
|
pixel.powerstate = "true"
|
||||||
console.log(pixel.powerstate+"n")
|
console.log(pixel.powerstate+"n")
|
||||||
pixel.color = "#94CF0D"
|
pixel.color = "#94CF0D"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue