simple invisible wall

element invisible_wall is wall but sets itself to the bg color
This commit is contained in:
O-01-67 2022-05-20 19:18:07 -04:00 committed by GitHub
parent 7f3e5c7405
commit 9d18b31473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

20
mods/invisible_wall.js Normal file
View File

@ -0,0 +1,20 @@
if(!settings) {
settings = {}
}
if(!settings.bg) {
settings.bg = "#000000"
}
elements.invisible_wall = {
color: settings.bg,
behavior: behaviors.WALL,
tick: function(pixel) {
var backgroundColor = hexToRGB(settings.bg);
var rgbValue = "rgb("+backgroundColor.r+","+backgroundColor.g+","+backgroundColor.b+")";
pixel.color = rgbValue;
},
hardness: 1,
category: "special",
state: "solid",
};