From 01cc070863526a75b51aea853e2ecd039d7797b6 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Thu, 23 Dec 2021 23:42:03 -0500 Subject: [PATCH] THERMAL CONDUCTIVITY and pollen --- changelog.txt | 15 ++++++++++++--- index.html | 29 ++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 20c84d5b..cecdb86d 100644 --- a/changelog.txt +++ b/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 @@ -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 @@ -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 diff --git a/index.html b/index.html index d4a9871d..636be5d1 100644 --- a/index.html +++ b/index.html @@ -308,6 +308,8 @@ "XX|DL:carbon_dioxide%50|XX", ], "category":"life", + "tempHigh": 300, + "stateHigh": "fire", "burn":65, "burnTime":50, }, @@ -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 @@ -2110,7 +2113,7 @@ } 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); } @@ -2118,11 +2121,35 @@ } + // 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) {