Merge pull request #445 from JustAGenericUsername/main

grid brush
This commit is contained in:
slweeb 2024-03-23 19:03:14 -04:00 committed by GitHub
commit fa6cd76330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 1 deletions

View File

@ -2368,4 +2368,24 @@ elements.spacedust = {
}
elements.acid.ignore.push("spacedust")
elements.acid.ignore.push("spacedust_cola")
elements.sun.breakInto = "spacedust"
elements.sun.breakInto = "spacedust"
var gridElem = 0
elements.grid_brush = {
color: elements.lattice.color,
behavior: behaviors.WALL,
category: "special",
movable: false,
onSelect: function() {
var gridans = prompt("Please input the desired element of this grid brush",(gridElem||undefined));
if (!gridans) { return }
gridElem = mostSimilarElement(gridans);
},
tick: function(pixel){
if (pixel.x%2 || pixel.y%2){
deletePixel(pixel.x, pixel.y)
createPixel(gridElem, pixel.x, pixel.y)
} else {
deletePixel(pixel.x, pixel.y)
}
}
}