2022-01-27 13:26:30 -05:00
|
|
|
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) }
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-28 10:52:14 -05:00
|
|
|
if(i == width) {
|
|
|
|
|
i = 1
|
|
|
|
|
}
|
2022-01-27 13:26:30 -05:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
category: "machines",
|
|
|
|
|
insulate: true,
|
|
|
|
|
state: "solid",
|
2022-01-31 09:55:36 -05:00
|
|
|
excludeRandom: true,
|
2022-01-27 13:26:30 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
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)" }
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-28 10:52:14 -05:00
|
|
|
if(i == width) {
|
|
|
|
|
i = 1
|
|
|
|
|
}
|
2022-01-27 13:26:30 -05:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
category: "machines",
|
|
|
|
|
insulate: true,
|
|
|
|
|
state: "solid",
|
2022-01-31 09:55:36 -05:00
|
|
|
excludeRandom: true,
|
2022-01-27 13:26:30 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
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]) }
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-28 10:52:14 -05:00
|
|
|
if(i == width) {
|
|
|
|
|
i = 1
|
|
|
|
|
}
|
2022-01-27 13:26:30 -05:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
category: "machines",
|
|
|
|
|
insulate: true,
|
|
|
|
|
state: "solid",
|
2022-01-31 09:55:36 -05:00
|
|
|
excludeRandom: true,
|
2022-02-11 11:22:55 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
elements.troll4 = {
|
|
|
|
|
color: "#eeeeee",
|
|
|
|
|
tick: function(pixel) {
|
|
|
|
|
for (var i = 1; i < width; i++) {
|
|
|
|
|
for (var j = 1; j < height; j++) {
|
|
|
|
|
var eeaa = (Math.floor(Math.random()*5))-2
|
|
|
|
|
if(Math.random() < 0.00007) { explodeAt(i,j,9+eeaa) }
|
|
|
|
|
if(j == height) { j == 1 }
|
|
|
|
|
}
|
|
|
|
|
if(i == height) { i == 1 }
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
category: "machines",
|
|
|
|
|
insulate: true,
|
|
|
|
|
hardness: 1.0,
|
|
|
|
|
state: "solid",
|
|
|
|
|
excludeRandom: true,
|
2022-02-11 20:10:45 -05:00
|
|
|
},
|
|
|
|
|
|
2022-02-11 20:14:54 -05:00
|
|
|
elements.offset_fourth_y = {
|
|
|
|
|
color: ["#000000", "#ff00ff", "#000000", "#ff00ff", "#000000", "#ff00ff", "#000000", "#ff00ff"],
|
|
|
|
|
tool: function(pixel) {
|
|
|
|
|
tryMove(pixel,pixel.x,pixel.y+0.25);
|
|
|
|
|
pixelTempCheck(pixel)
|
|
|
|
|
},
|
|
|
|
|
category: "tools",
|
|
|
|
|
},
|
|
|
|
|
|
2022-02-11 20:10:45 -05:00
|
|
|
elements.offset_half_y = {
|
|
|
|
|
color: ["#000000", "#ff00ff", "#000000", "#ff00ff", "#000000", "#ff00ff", "#000000", "#ff00ff"],
|
|
|
|
|
tool: function(pixel) {
|
|
|
|
|
tryMove(pixel,pixel.x,pixel.y+0.5);
|
|
|
|
|
pixelTempCheck(pixel)
|
|
|
|
|
},
|
|
|
|
|
category: "tools",
|
2022-02-11 20:14:54 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
elements.offset_three_fourth_y = {
|
|
|
|
|
color: ["#000000", "#ff00ff", "#000000", "#ff00ff", "#000000", "#ff00ff", "#000000", "#ff00ff"],
|
|
|
|
|
tool: function(pixel) {
|
|
|
|
|
tryMove(pixel,pixel.x,pixel.y+0.75);
|
|
|
|
|
pixelTempCheck(pixel)
|
|
|
|
|
},
|
|
|
|
|
category: "tools",
|
2022-02-26 17:29:37 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
elements.troll5 = {
|
|
|
|
|
color: "#eeeeee",
|
|
|
|
|
tick: function() {
|
|
|
|
|
for (var i = 1; i < width; i++) {
|
|
|
|
|
for (var j = 1; j < height; j++) {
|
|
|
|
|
if (!isEmpty(i,j)) {
|
|
|
|
|
if(!pixelMap[i][j].r) {
|
|
|
|
|
pixelMap[i][j].r = 0
|
|
|
|
|
}
|
|
|
|
|
pixelMap[i][j].r = (pixelMap[i][j].r + 1) % 4
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
category: "machines",
|
|
|
|
|
insulate: true,
|
|
|
|
|
state: "solid",
|
|
|
|
|
excludeRandom: true,
|
2022-01-28 10:52:14 -05:00
|
|
|
}
|