Update flipflop.js

This commit is contained in:
felixs-alt 2023-09-26 10:38:08 +02:00 committed by GitHub
parent 826395a5ac
commit 7c55edc462
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 13 deletions

View File

@ -1,4 +1,5 @@
elements.flipflop = {
powerstate: "false",
name: "Flip Flop",
color: "#CF300D",
state: "solid",
@ -9,12 +10,12 @@ elements.flipflop = {
doBurning(pixel)
doElectricity(pixel)
let Powerstate
let Powerstate = pixel.powerst
let Output = pixelMap[pixel.x+1][pixel.y]
let Input = pixelMap[pixel.x-1][pixel.y]
Output.charge = 0
if (Powerstate == true && Input.charge > 0.9) {
Powerstate == false
if (Powerstate == "true" && Input.charge > 0.9) {
Powerstate == "false"
pixel.color = "#CF300D"
Output.charge = 0
} else if (Powerstate == false && Input.charge < 0.9) {