Merge pull request #281 from JustAGenericUsername/main

elemment ifller
This commit is contained in:
slweeb 2024-01-15 16:56:36 -05:00 committed by GitHub
commit 711f35a91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 1 deletions

View File

@ -2003,4 +2003,38 @@ elements.dyer = {
}
}
}
}
}
elemfillerVar = 0;
elements.element_filler = {
category: "special",
color: elements.filler.color,
state: "solid",
movable: "false",
onSelect: function() {
var answer6 = prompt("Please input the desired element of this filler. It will not work if you do multiple filter types while paused.",(elemfillerVar||undefined));
if (!answer6) { return }
elemfillerVar = answer6;
},
tick: function(pixel){
var neighbors = 0;
if(!pixel.changeElem){
pixel.changeElem = elemfillerVar;
}
for (var i = 0; i < squareCoords.length; i++) {
var coord = squareCoords[i];
var x = pixel.x+coord[0];
var y = pixel.y+coord[1];
if (!isEmpty(x,y, true)) {
neighbors = neighbors + 1;
} else if (isEmpty(x, y)){
createPixel("element_filler", x, y)
pixelMap[x][y].changeElem = pixel.changeElem;
} else (
changePixel(pixel, pixel.changeElem)
)
}
if (neighbors >= 8){
changePixel(pixel, pixel.changeElem)
}
}
}