Skip to content

Commit

Permalink
THERMAL CONDUCTIVITY
Browse files Browse the repository at this point in the history
and pollen
  • Loading branch information
slweeb committed Dec 24, 2021
1 parent e27288a commit 01cc070
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
15 changes: 12 additions & 3 deletions changelog.txt
@@ -1,4 +1,13 @@
[Version 0.5.2 - December 22, 2021]
[Future Plans]
+ Density Update
+ Reactions Update
+ Electricity & Machines Update

[Version 0.6 - Thermal Conductivity - Dec. 23, 2021]
+ Thermal Conductivity / Heat Transfer
+ Bees now drop pollen which turns into flower seeds

[Version 0.5.2 - Dec. 22, 2021]
+ Antimatter
+ Acid Cloud
+ Acid Gas
Expand All @@ -15,7 +24,7 @@
+ All molten elements now spawn fire like magma
~ Fixed: NaN fire temperatures

[Version 0.5.1 - December 22, 2021]
[Version 0.5.1 - Dec. 22, 2021]
+ Erase tool
+ Pick tool (Middle click works too)
+ Press E to select an element by name
Expand All @@ -30,7 +39,7 @@
~ Fixed: Shift icon [⬆ ] doesn't show when hovering outside of game
~ Fixed: Console error sometimes when page loads

[Version 0.5 - December 21, 2021]
[Version 0.5 - Dec. 21, 2021]
+ New name: Sandboxels (Sandbox + Pixels)
+ Mushrooms
+ Mushroom Spore grows a mushroom
Expand Down
29 changes: 28 additions & 1 deletion index.html
Expand Up @@ -308,6 +308,8 @@
"XX|DL:carbon_dioxide%50|XX",
],
"category":"life",
"tempHigh": 300,
"stateHigh": "fire",
"burn":65,
"burnTime":50,
},
Expand Down Expand Up @@ -1885,6 +1887,7 @@
arg = arg.split(",")[Math.floor(Math.random()*arg.split(",").length)];
}
createPixel(arg,newCoords.x,newCoords.y);
pixelMap[newCoords.x][newCoords.y].temp = pixel.temp
}
}
//Leave behind element
Expand Down Expand Up @@ -2110,19 +2113,43 @@
}
else if (pixel.element != "fire" && isEmpty(pixel.x,pixel.y-1) && Math.floor(Math.random()*100)<10) {
createPixel("fire",pixel.x,pixel.y-1);
pixelMap[pixel.x][pixel.y-1].temp = pixel.temp+(pixelTicks - (pixel.burnStart || 0));
pixelMap[pixel.x][pixel.y-1].temp = pixel.temp//+(pixelTicks - (pixel.burnStart || 0));
if (info.fireColor != undefined) {
pixelMap[pixel.x][pixel.y-1].color = pixelColorPick(pixelMap[pixel.x][pixel.y-1],info.fireColor);
}
}

}

// Change tempearture if needed
if (info.tempChange != undefined) {
pixel.temp += info.tempChange;
pixelTempCheck(pixel);
}

// Heat Transfer
// Check right and bottom adjacent pixels
coordsToCheck = [
{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];
if (!isEmpty(coords.x,coords.y) && !outOfBounds(coords.x,coords.y)) {
var newPixel = pixelMap[coords.x][coords.y];
// Skip if both temperatures are the same
if (pixel.temp == newPixel.temp) {
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);
}
}


}
function pixelColorPick(pixel,customColor=null) {
Expand Down

0 comments on commit 01cc070

Please sign in to comment.