more heat transfer updates
This commit is contained in:
parent
01cc070863
commit
f0b6db96dd
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
[Version 0.6 - Thermal Conductivity - Dec. 23, 2021]
|
[Version 0.6 - Thermal Conductivity - Dec. 23, 2021]
|
||||||
+ Thermal Conductivity / Heat Transfer
|
+ Thermal Conductivity / Heat Transfer
|
||||||
|
+ Insulation
|
||||||
|
+ Walls insulate
|
||||||
+ Bees now drop pollen which turns into flower seeds
|
+ Bees now drop pollen which turns into flower seeds
|
||||||
|
|
||||||
[Version 0.5.2 - Dec. 22, 2021]
|
[Version 0.5.2 - Dec. 22, 2021]
|
||||||
|
|
|
||||||
90
index.html
90
index.html
|
|
@ -333,6 +333,7 @@
|
||||||
"behavior": behaviors.WALL,
|
"behavior": behaviors.WALL,
|
||||||
"density": 0,
|
"density": 0,
|
||||||
"category": "solids",
|
"category": "solids",
|
||||||
|
"insulate": true,
|
||||||
},
|
},
|
||||||
"fire": {
|
"fire": {
|
||||||
"name": "fire",
|
"name": "fire",
|
||||||
|
|
@ -681,21 +682,23 @@
|
||||||
"name": "heater",
|
"name": "heater",
|
||||||
"color": "#881111",
|
"color": "#881111",
|
||||||
"behavior": [
|
"behavior": [
|
||||||
"XX|HT|XX",
|
"XX|HT:2|XX",
|
||||||
"HT|XX|HT",
|
"HT:2|XX|HT:2",
|
||||||
"XX|HT|XX",
|
"XX|HT:2|XX",
|
||||||
],
|
],
|
||||||
"category":"machines",
|
"category":"machines",
|
||||||
|
"insulate":true,
|
||||||
},
|
},
|
||||||
"cooler": {
|
"cooler": {
|
||||||
"name": "cooler",
|
"name": "cooler",
|
||||||
"color": "#111188",
|
"color": "#111188",
|
||||||
"behavior": [
|
"behavior": [
|
||||||
"XX|CO|XX",
|
"XX|CO:2|XX",
|
||||||
"CO|XX|CO",
|
"CO:2|XX|CO:2",
|
||||||
"XX|CO|XX",
|
"XX|CO:2|XX",
|
||||||
],
|
],
|
||||||
"category":"machines",
|
"category":"machines",
|
||||||
|
"insulate":true,
|
||||||
},
|
},
|
||||||
"superheater": {
|
"superheater": {
|
||||||
"name": "superheater",
|
"name": "superheater",
|
||||||
|
|
@ -706,6 +709,7 @@
|
||||||
"XX|HT:10|XX",
|
"XX|HT:10|XX",
|
||||||
],
|
],
|
||||||
"category":"machines",
|
"category":"machines",
|
||||||
|
"insulate":true,
|
||||||
},
|
},
|
||||||
"freezer": {
|
"freezer": {
|
||||||
"name": "freezer",
|
"name": "freezer",
|
||||||
|
|
@ -716,6 +720,7 @@
|
||||||
"XX|CO:10|XX",
|
"XX|CO:10|XX",
|
||||||
],
|
],
|
||||||
"category":"machines",
|
"category":"machines",
|
||||||
|
"insulate":true,
|
||||||
},
|
},
|
||||||
"smoke_grenade": {
|
"smoke_grenade": {
|
||||||
"name": "smoke grenade",
|
"name": "smoke grenade",
|
||||||
|
|
@ -1563,6 +1568,13 @@
|
||||||
],
|
],
|
||||||
"category": "life",
|
"category": "life",
|
||||||
},
|
},
|
||||||
|
"insulation": {
|
||||||
|
"name": "insulation",
|
||||||
|
"color": "#b8aea5",
|
||||||
|
"behavior": behaviors.WALL,
|
||||||
|
"category": "structure",
|
||||||
|
"insulate": true,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1913,22 +1925,26 @@
|
||||||
else if (b == "HT") {
|
else if (b == "HT") {
|
||||||
if (!isEmpty(newCoords.x,newCoords.y) && !outOfBounds(newCoords.x,newCoords.y)) {
|
if (!isEmpty(newCoords.x,newCoords.y) && !outOfBounds(newCoords.x,newCoords.y)) {
|
||||||
var newPixel = pixelMap[newCoords.x][newCoords.y];
|
var newPixel = pixelMap[newCoords.x][newCoords.y];
|
||||||
if (arg != null) {arg = parseFloat(arg)}
|
if (!(newPixel.element == pixel.element)) {
|
||||||
else {arg = 1}
|
if (arg != null) {arg = parseFloat(arg)}
|
||||||
if (arg == NaN) {arg = 1}
|
else {arg = 1}
|
||||||
newPixel.temp += arg;
|
if (arg == NaN) {arg = 1}
|
||||||
pixelTempCheck(newPixel);
|
newPixel.temp += arg;
|
||||||
|
pixelTempCheck(newPixel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Cool
|
//Cool
|
||||||
else if (b == "CO") {
|
else if (b == "CO") {
|
||||||
if (!isEmpty(newCoords.x,newCoords.y) && !outOfBounds(newCoords.x,newCoords.y)) {
|
if (!isEmpty(newCoords.x,newCoords.y) && !outOfBounds(newCoords.x,newCoords.y)) {
|
||||||
var newPixel = pixelMap[newCoords.x][newCoords.y];
|
var newPixel = pixelMap[newCoords.x][newCoords.y];
|
||||||
if (arg != null) {arg = parseFloat(arg)}
|
if (!(newPixel.element == pixel.element)) {
|
||||||
else {arg = 1}
|
if (arg != null) {arg = parseFloat(arg)}
|
||||||
if (arg == NaN) {arg = 1}
|
else {arg = 1}
|
||||||
newPixel.temp -= arg;
|
if (arg == NaN) {arg = 1}
|
||||||
pixelTempCheck(newPixel);
|
newPixel.temp -= arg;
|
||||||
|
pixelTempCheck(newPixel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Change color
|
//Change color
|
||||||
|
|
@ -2128,25 +2144,27 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Heat Transfer
|
// Heat Transfer
|
||||||
// Check right and bottom adjacent pixels
|
if (!(info.insulate == true)) {
|
||||||
coordsToCheck = [
|
// Check right and bottom adjacent pixels
|
||||||
{x:pixel.x+1,y:pixel.y},
|
coordsToCheck = [
|
||||||
{x:pixel.x,y:pixel.y+1},
|
{x:pixel.x+1,y:pixel.y},
|
||||||
];
|
{x:pixel.x,y:pixel.y+1},
|
||||||
for (var i = 0; i < coordsToCheck.length; i++) {
|
];
|
||||||
var coords = coordsToCheck[i];
|
for (var i = 0; i < coordsToCheck.length; i++) {
|
||||||
if (!isEmpty(coords.x,coords.y) && !outOfBounds(coords.x,coords.y)) {
|
var coords = coordsToCheck[i];
|
||||||
var newPixel = pixelMap[coords.x][coords.y];
|
if (!isEmpty(coords.x,coords.y) && !outOfBounds(coords.x,coords.y)) {
|
||||||
// Skip if both temperatures are the same
|
var newPixel = pixelMap[coords.x][coords.y];
|
||||||
if (pixel.temp == newPixel.temp) {
|
// Skip if both temperatures are the same
|
||||||
continue;
|
if (pixel.temp == newPixel.temp || elements[newPixel.element].insulate == true) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Set both pixel temperatures to their average
|
||||||
|
var avg = (pixel.temp + newPixel.temp)/2;
|
||||||
|
pixel.temp = avg;
|
||||||
|
newPixel.temp = avg;
|
||||||
|
pixelTempCheck(pixel);
|
||||||
|
pixelTempCheck(newPixel);
|
||||||
}
|
}
|
||||||
// Set both pixel temperatures to their average
|
|
||||||
var avg = (pixel.temp + newPixel.temp)/2;
|
|
||||||
pixel.temp = avg;
|
|
||||||
newPixel.temp = avg;
|
|
||||||
pixelTempCheck(pixel);
|
|
||||||
pixelTempCheck(newPixel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2374,8 +2392,8 @@
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var pixel = pixelMap[x][y];
|
var pixel = pixelMap[x][y];
|
||||||
if (shiftDown) {pixel.temp += element.temp+(Math.random()*element.temp/5)*20;}
|
if (shiftDown) {pixel.temp += element.temp+(Math.random()*element.temp*1.5)*20;}
|
||||||
else {pixel.temp += element.temp+(Math.random()*element.temp/5);}
|
else {pixel.temp += element.temp+(Math.random()*element.temp*1.5);}
|
||||||
pixelTempCheck(pixel);
|
pixelTempCheck(pixel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue