parent
345df9429b
commit
bc221baf65
|
|
@ -598,6 +598,7 @@ elements.void_first = {
|
||||||
elements.converter = {
|
elements.converter = {
|
||||||
color: "#2ec408",
|
color: "#2ec408",
|
||||||
tick: function(pixel) {
|
tick: function(pixel) {
|
||||||
|
if(!pixel.changeTo) {
|
||||||
//store 4 touching pixels in variables if the variables don't exist
|
//store 4 touching pixels in variables if the variables don't exist
|
||||||
if(!outOfBounds(pixel.x,pixel.y-1) && !isEmpty(pixel.x,pixel.y-1)) {
|
if(!outOfBounds(pixel.x,pixel.y-1) && !isEmpty(pixel.x,pixel.y-1)) {
|
||||||
if(!pixel.dc1 && pixelMap[pixel.x][pixel.y-1].element != pixel.element) {
|
if(!pixel.dc1 && pixelMap[pixel.x][pixel.y-1].element != pixel.element) {
|
||||||
|
|
@ -765,6 +766,14 @@ elements.converter = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if(pixel.changeTo) {
|
||||||
|
if(pixel.dc1 || pixel.dc2 || pixel.dc3 || pixel.dc4) {
|
||||||
|
delete pixel.dc1;
|
||||||
|
delete pixel.dc2;
|
||||||
|
delete pixel.dc3;
|
||||||
|
delete pixel.dc4;
|
||||||
|
}
|
||||||
|
}
|
||||||
neighbors = [[-1,0],[0,-1],[1,0],[0,1]]
|
neighbors = [[-1,0],[0,-1],[1,0],[0,1]]
|
||||||
for(i = 0; i < neighbors.length; i++) {
|
for(i = 0; i < neighbors.length; i++) {
|
||||||
if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) {
|
if(!isEmpty(pixel.x+neighbors[i][0],pixel.y+neighbors[i][1],true)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue