Merge pull request #612 from JustAGenericUsername/main
pew pew HAHA!!!!
This commit is contained in:
commit
50fe68ac8e
|
|
@ -2709,7 +2709,8 @@ elements.ray_emitter = {
|
||||||
if (!rayans) { return }
|
if (!rayans) { return }
|
||||||
rayElement = mostSimilarElement(rayans);
|
rayElement = mostSimilarElement(rayans);
|
||||||
var rayans2 = prompt("Should the ray stop by walls? Write true or false.",(rayStoppedByWalls||false));
|
var rayans2 = prompt("Should the ray stop by walls? Write true or false.",(rayStoppedByWalls||false));
|
||||||
if (!rayans2 || rayans2 !== "true" || rayans2 !== "false") { return }
|
if (!rayans2) { rayans2 = false } else { rayans2 = true }
|
||||||
|
rayStoppedByWalls = rayans2
|
||||||
},
|
},
|
||||||
hoverStat: function(pixel){
|
hoverStat: function(pixel){
|
||||||
return pixel.rayElement.toUpperCase() || "unset"
|
return pixel.rayElement.toUpperCase() || "unset"
|
||||||
|
|
@ -2743,9 +2744,17 @@ elements.ray_emitter = {
|
||||||
if (isEmpty(lx,ly)){
|
if (isEmpty(lx,ly)){
|
||||||
createPixel(pixel.rayElement, lx, ly)
|
createPixel(pixel.rayElement, lx, ly)
|
||||||
pixelMap[lx][ly].temp = pixelMap[x][y].temp
|
pixelMap[lx][ly].temp = pixelMap[x][y].temp
|
||||||
|
if (pixel.rayElement == "ray"){
|
||||||
|
pixelMap[lx][ly].rColor = pixel.color
|
||||||
|
pixelMap[lx][ly].color = pixel.color
|
||||||
|
}
|
||||||
} else if (!isEmpty(lx, ly, true)){
|
} else if (!isEmpty(lx, ly, true)){
|
||||||
if (pixelMap[lx][ly].element != pixel.rayElement && pixel.rayStoppedByWalls){
|
if (pixelMap[lx][ly].element != pixel.rayElement && pixel.rayStoppedByWalls){
|
||||||
break;
|
break;
|
||||||
|
} else if (pixelMap[lx][ly].element == "ray" && pixel.rayElement == "ray"){
|
||||||
|
pixelMap[lx][ly].rColor = pixel.color
|
||||||
|
pixelMap[lx][ly].life = 30
|
||||||
|
pixelMap[lx][ly].color = pixel.color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2763,6 +2772,7 @@ elements.indestructible_battery = {
|
||||||
elements.ray = {
|
elements.ray = {
|
||||||
color: "#ffffff",
|
color: "#ffffff",
|
||||||
behavior: behaviors.WALL,
|
behavior: behaviors.WALL,
|
||||||
|
movable: true,
|
||||||
category: "special",
|
category: "special",
|
||||||
hoverStat: function(pixel){
|
hoverStat: function(pixel){
|
||||||
return pixel.life || "unset"
|
return pixel.life || "unset"
|
||||||
|
|
@ -2771,8 +2781,15 @@ elements.ray = {
|
||||||
life: 30
|
life: 30
|
||||||
},
|
},
|
||||||
tick: function(pixel){
|
tick: function(pixel){
|
||||||
|
if (pixel.rColor){
|
||||||
|
pixel.rgb = pixel.rColor.match(/\d+/g);
|
||||||
|
} else {
|
||||||
|
pixel.rgb = [255,255,255]
|
||||||
|
}
|
||||||
pixel.life -= 1
|
pixel.life -= 1
|
||||||
pixel.color = "rgba(255,255,255,"+(pixel.life/30)+")"
|
if (pixel.life < 30){
|
||||||
|
pixel.color = "rgba("+pixel.rgb[0]+","+pixel.rgb[1]+","+pixel.rgb[2]+","+(pixel.life/30)+")"
|
||||||
|
} else {pixel.color = "rgba("+pixel.rgb[0]+","+pixel.rgb[1]+","+pixel.rgb[2]+",1)"}
|
||||||
if (pixel.life <= 0){
|
if (pixel.life <= 0){
|
||||||
deletePixel(pixel.x, pixel.y)
|
deletePixel(pixel.x, pixel.y)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue