trolol
This commit is contained in:
Lily-129 2022-01-27 13:26:30 -05:00 committed by GitHub
parent 025fd3abe5
commit 42f3e9dd87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 47 additions and 0 deletions

47
mods/troll.js Normal file
View File

@ -0,0 +1,47 @@
elements.troll1 = {
color: "#eeeeee",
tick: function(pixel) {
for (var i = 1; i < width; i++) {
for (var j = 1; j < height; j++) {
if (!isEmpty(i,j)) {
if(Math.random() < 0.003 && pixelMap[i][j].element != pixel.element) { deletePixel(i,j) }
}
}
}
},
category: "machines",
insulate: true,
state: "solid",
},
elements.troll2 = {
color: "#eeeeee",
tick: function(pixel) {
for (var i = 1; i < width; i++) {
for (var j = 1; j < height; j++) {
if (!isEmpty(i,j)) {
if(Math.random() < 0.005) { pixelMap[i][j].color = "rgb(0,0,0)" }
}
}
}
},
category: "machines",
insulate: true,
state: "solid",
},
elements.troll3 = {
color: "#eeeeee",
tick: function(pixel) {
for (var i = 1; i < width; i++) {
for (var j = 1; j < height; j++) {
if (!isEmpty(i,j)) {
if(Math.random() < 0.05) { swapPixels(pixel,pixelMap[i][j]) }
}
}
}
},
category: "machines",
insulate: true,
state: "solid",
}