selective void

This commit is contained in:
JustAGenericUsername 2024-03-11 17:33:52 -04:00
parent 4173f2fb11
commit f5e923afb1
1 changed files with 30 additions and 1 deletions

View File

@ -2274,4 +2274,33 @@ elements.insulating_filler = {
category: elements.filler.category,
state: elements.filler.state,
insulate: true
}
}
selvoid = 0;
elements.selective_void = {
category: "special",
color: elements.void.color,
excludeRandom: true,
state: "solid",
movable: "false",
onSelect: function() {
var selvoidans = prompt("Please input the desired element of this void. It will not work if you do multiple void types while paused.",(selvoid||undefined));
if (!selvoidans) { return }
selvoid = mostSimilarElement(selvoidans);
},
tick: function(pixel){
var neighbors = 0;
if(!pixel.changeElem){
pixel.changeElem = selvoid;
}
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)) {
var otherPixel = pixelMap[x][y]
if (otherPixel.element == pixel.changeElem)
deletePixel(x, y)
}
}
}
}