Sandboxels 1.8.1
HUGE SANDBOXELS UPDATE 1.8.1
**Lightning**
Feeling evil? Summon hot, powerful bolts of lightning. Smite anything at your will, hot enough to incinerate or melt anything.
**Bless**
Feeling merciful? Solve any problem with your omnipotent blessing. Cure disease, fight fires, undo your nuclear explosions.
**There's More!**
+ Thunder Cloud
+ God Ray
+ Heat Ray
~ Reworked Vines
+ Vines hang from ceilings and walls
+ Vines spread naturally sideways, down, and on walls
+ Rotten Cheese (Hidden)
+ Herb
+ Tea (Hidden)
+ Rime (Hidden)
~ Improved load times
73 MORE CHANGES and 12 BUG FIXES: https://sandboxels.R74n.com/changelog.txt
PLAY NOW: https://sandboxels.R74n.com/
This commit is contained in:
parent
c2fae94e5f
commit
27e3302345
|
|
@ -0,0 +1,234 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Sandbox Game</title>
|
||||
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
html, body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
font-family: 'Press Start 2P';
|
||||
background-color: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
h1 {
|
||||
padding: 10px;
|
||||
}
|
||||
canvas {
|
||||
border: 1px solid #ffffff;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -0%);
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// Object storing the various movement behaviors, represented by a number
|
||||
var behaviors = {
|
||||
"DL_DR": 0,
|
||||
"L_R": 1,
|
||||
"WALL": 2,
|
||||
}
|
||||
|
||||
// Object storing various powders, called elements
|
||||
var elements = {
|
||||
"sand": {
|
||||
"name": "sand",
|
||||
"color": "#ffffff",
|
||||
"description": "A pile of sand. It's not very dense, but it's still pretty heavy.",
|
||||
"behavior": behaviors.DL_DR,
|
||||
},
|
||||
"water": {
|
||||
"name": "water",
|
||||
"color": "#0000ff",
|
||||
"description": "A pool of water. Is it wet? Is it dry? Who knows.",
|
||||
"behavior": behaviors.L_R,
|
||||
},
|
||||
"wall": {
|
||||
"name": "wall",
|
||||
"color": "#808080",
|
||||
"description": "A wall. It's pretty solid.",
|
||||
"behavior": behaviors.WALL,
|
||||
},
|
||||
}
|
||||
|
||||
currentPixels = [];
|
||||
// Pixel class, with attributes such as x, y, and element
|
||||
class Pixel {
|
||||
constructor(x, y, element) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.element = element;
|
||||
this.color = elements[element].color;
|
||||
pixelMap[x][y] = this;
|
||||
}
|
||||
}
|
||||
pixelSize = 10;
|
||||
|
||||
function isEmpty(x, y) {
|
||||
// If y > height or y < 0 or x > width or x < 0, return false
|
||||
if (y > height-1 || y < 1 || x > width-1 || x < 1) {
|
||||
return false;
|
||||
}
|
||||
return pixelMap[x][y] == undefined;
|
||||
}
|
||||
function movePixel(pixel,x,y) {
|
||||
// Delete the pixel from the old position
|
||||
delete pixelMap[pixel.x][pixel.y];
|
||||
pixel.x = x;
|
||||
pixel.y = y;
|
||||
pixelMap[x][y] = pixel;
|
||||
}
|
||||
|
||||
function pixelTick(pixel) {
|
||||
var info = elements[pixel.element];
|
||||
var x = pixel.x;
|
||||
var y = pixel.y;
|
||||
if (info.behavior == behaviors.DL_DR) {
|
||||
if (isEmpty(x,y+1)) { movePixel(pixel,x,y+1); }
|
||||
else {
|
||||
if (Math.floor(Math.random() * 2) == 1) {
|
||||
if (isEmpty(x-1,y+1)) { movePixel(pixel,x-1,y+1); }
|
||||
else if (isEmpty(x+1,y+1)) { movePixel(pixel,x+1,y+1); }
|
||||
}
|
||||
else {
|
||||
if (isEmpty(x+1,y+1)) { movePixel(pixel,x+1,y+1); }
|
||||
else if (isEmpty(x-1,y+1)) { movePixel(pixel,x-1,y+1); }
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (info.behavior == behaviors.L_R) {
|
||||
if (isEmpty(x,y+1)) { movePixel(pixel,x,y+1); }
|
||||
else {
|
||||
if (Math.floor(Math.random() * 2) == 1) {
|
||||
if (isEmpty(x-1,y)) { movePixel(pixel,x-1,y); }
|
||||
else if (isEmpty(x+1,y)) { movePixel(pixel,x+1,y); }
|
||||
}
|
||||
else {
|
||||
if (isEmpty(x+1,y)) { movePixel(pixel,x+1,y); }
|
||||
else if (isEmpty(x-1,y)) { movePixel(pixel,x-1,y); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function tick() {
|
||||
// Get the canvas
|
||||
var canvas = document.getElementById("game");
|
||||
var ctx = canvas.getContext("2d");
|
||||
// Clear the canvas
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
// Draw the current pixels
|
||||
for (var i = 0; i < currentPixels.length; i++) {
|
||||
pixel = currentPixels[i];
|
||||
pixelTick(pixel);
|
||||
ctx.fillStyle = pixel.color;
|
||||
ctx.fillRect(pixel.x*10, pixel.y*10, 10, 10);
|
||||
}
|
||||
// If mouseIsDown, do mouse1Action
|
||||
if (mouseIsDown) {
|
||||
mouse1Action(null,mousePos.x,mousePos.y);
|
||||
}
|
||||
}
|
||||
|
||||
currentElement = "sand";
|
||||
mouseIsDown = false;
|
||||
function mouseClick(e) {
|
||||
mouseIsDown = true;
|
||||
mouseMove(e);
|
||||
}
|
||||
function mouseUp(e) {
|
||||
mouseIsDown = false;
|
||||
}
|
||||
|
||||
function getMousePos(canvas, evt) {
|
||||
var rect = canvas.getBoundingClientRect();
|
||||
return {
|
||||
// Round to nearest pixel
|
||||
x: Math.round((evt.clientX - rect.left)/pixelSize),
|
||||
y: Math.round((evt.clientY - rect.top)/pixelSize)
|
||||
};
|
||||
}
|
||||
function mouseMove(e) {
|
||||
if (mouseIsDown) {
|
||||
mouse1Action(e);
|
||||
}
|
||||
}
|
||||
function mouse1Action(e,mouseX=undefined,mouseY=undefined) {
|
||||
// If x and y are undefined, get the mouse position
|
||||
if (mouseX == undefined && mouseY == undefined) {
|
||||
var canvas = document.getElementById("game");
|
||||
var ctx = canvas.getContext("2d");
|
||||
mousePos = getMousePos(canvas, e);
|
||||
var mouseX = mousePos.x;
|
||||
var mouseY = mousePos.y;
|
||||
}
|
||||
if (isEmpty(mouseX, mouseY)) {
|
||||
currentPixels.push(new Pixel(mouseX, mouseY, currentElement));
|
||||
}
|
||||
}
|
||||
|
||||
// On window load, run tick() 20 times per second
|
||||
window.setInterval(tick, 50);
|
||||
|
||||
// When W is pressed, change the current element to water
|
||||
document.onkeydown = function(e) {
|
||||
if (e.keyCode == 87) {
|
||||
currentElement = "water";
|
||||
}
|
||||
// If it is S, change the current element to sand
|
||||
else if (e.keyCode == 83) {
|
||||
currentElement = "sand";
|
||||
}
|
||||
// if its X, change to wall
|
||||
else if (e.keyCode == 88) {
|
||||
currentElement = "wall";
|
||||
}
|
||||
}
|
||||
|
||||
//on window load
|
||||
window.onload = function() {
|
||||
// While the mouse is down, run mouseDown()
|
||||
var gameCanvas = document.getElementById("game");
|
||||
// Get context
|
||||
var ctx = gameCanvas.getContext("2d");
|
||||
var newWidth = Math.ceil(window.innerWidth*0.9 / 10) * 10;
|
||||
var newHeight = Math.ceil(window.innerHeight*0.675 / 10) * 10;
|
||||
// If the new width is greater than 800, set it to 800
|
||||
if (newWidth > 800) { newWidth = 800; }
|
||||
// If the new height is greater than 600, set it to 600
|
||||
if (newHeight > 600) { newHeight = 600; }
|
||||
ctx.canvas.width = newWidth;
|
||||
ctx.canvas.height = newHeight;
|
||||
|
||||
width = Math.round(newWidth/pixelSize)-1;
|
||||
height = Math.round(newHeight/pixelSize)-1;
|
||||
// Object with width arrays of pixels starting at 0
|
||||
pixelMap = {};
|
||||
for (var i = 0; i < width; i++) {
|
||||
pixelMap[i] = [];
|
||||
}
|
||||
//...drawing code...
|
||||
gameCanvas.addEventListener("mousedown", mouseClick);
|
||||
gameCanvas.addEventListener("mouseup", mouseUp);
|
||||
gameCanvas.addEventListener("mousemove", mouseMove);
|
||||
gameCanvas.ontouchstart = function(e) {
|
||||
if (e.touches) e = e.touches[0];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Sandbox Game</h1>
|
||||
<canvas id="game" width="800" height="600" oncontextmenu="return false;">
|
||||
Your browser does not support the HTML5 canvas tag.
|
||||
</canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
111
changelog.txt
111
changelog.txt
|
|
@ -1,7 +1,112 @@
|
|||
[Future Plans]
|
||||
+ Save Gallery
|
||||
+ Human Update
|
||||
+ Baking Update
|
||||
+ More plans / suggestions at https://docs.google.com/document/u/4/d/1R8xljj_J-K5oU-9y4louwplQmM-ZBvUfXmhbgj5LYdk/edit
|
||||
+ Suggest new additions at https://link.r74n.com/sandboxels-feedback
|
||||
|
||||
See sneak peaks for upcoming updates on the Discord: https://discord.gg/ejUc6YPQuS
|
||||
|
||||
[Version 1.8.1 - April 14, 2023 - Striking Detail]
|
||||
+ Lightning (!!!)
|
||||
+ Bless
|
||||
+ Thunder Cloud
|
||||
+ God Ray
|
||||
+ Heat Ray
|
||||
+ Rotten Cheese (Hidden)
|
||||
+ Herb
|
||||
+ Tea (Hidden)
|
||||
+ Rime (Hidden)
|
||||
+ Frozen Worm (Hidden)
|
||||
+ Frozen Ink (Hidden)
|
||||
+ Poison Ice (Hidden)
|
||||
+ Rain world gen type
|
||||
+ Changelog notification after new update
|
||||
+ Version number shown below game
|
||||
~ Improved load times
|
||||
[Changes]
|
||||
~ Reworked Vines
|
||||
+ Vines hang from ceilings and walls
|
||||
+ Vines spread naturally sideways, down, and on walls
|
||||
+ Frogs can absorb harmful pollutants through their skin (Educational!)
|
||||
+ Sun brown dwarf stage
|
||||
+ Mercury can conduct electricity
|
||||
+ Plant, Grass, and Vine break into Dead Plant
|
||||
+ Insects break into Dead Bugs
|
||||
+ Borax can kill insects
|
||||
+ Ants, Frogs, Fish, and Birds can eat Dead Bugs
|
||||
+ Ants and Flies can eat Cheese
|
||||
+ Birds and Rats can eat Lichen
|
||||
+ Fish can eat Tadpoles
|
||||
+ Fish and Tadpoles can swim in Seltzer and Pool Water
|
||||
+ Radiation can make Frogs young again
|
||||
+ Worms can compost Dead Bugs
|
||||
+ Worms can break down Mudstone, Permafrost, and Packed Sand
|
||||
+ Worms can eat Sawdust, Tinder, Dust, and Rotten Meat
|
||||
+ Worms can break down Eggs slowly
|
||||
+ Eggs will die when frozen
|
||||
+ Rats can eat Gingerbread, Yogurt, and Beans
|
||||
+ Ammonia can kill Rats
|
||||
+ Plants absorb Carbon Dioxide from Seltzer
|
||||
+ Plants can clean Smog
|
||||
+ Ice Nine can convert Rad Steam
|
||||
+ Rad Steam can radiate Glass
|
||||
+ Stench can be burned away by Fire
|
||||
+ Soap cleans Smog and Stench
|
||||
+ Soap dissolves in Water
|
||||
+ Steam is a very bad electrical conductor
|
||||
+ Juice can wet soils
|
||||
+ Pool Water, Blood, Soda, and Milk can wet Clay Soil
|
||||
+ Bubble, Steam, Foam, Acid, Primordial Soup, Vaccine, and Antidote can clean stains
|
||||
+ Malware can damage Wires
|
||||
+ Cancer can damage Plant
|
||||
+ Cancer can spread to Bones
|
||||
+ Bone Marrow can freeze and be poisoned
|
||||
+ AlGa and Water reaction
|
||||
+ Stink Bugs can be radiated
|
||||
+ Info page shows decimal points if density is low
|
||||
+ New random event element choices
|
||||
+ More Bleach reactions
|
||||
+ Neutral Acid can vaporize
|
||||
+ Vinegar can kill Mushrooms and Pollen
|
||||
+ Poison, Bleach, Seltzer, and Pool Water can kill Pollen
|
||||
~ Fireflies will kill Frogs if eaten
|
||||
~ Recolored Mycelium
|
||||
~ Unhid Mycelium
|
||||
~ Hid Positron
|
||||
~ Moved Worm apart from insects
|
||||
~ Moved Unpaint to Special
|
||||
~ Flies no longer eat living plants
|
||||
~ Worms no longer decompose growing plants
|
||||
~ EMP Bomb is no longer limited to cursor size 1
|
||||
~ Smog condensates into Dirty Water
|
||||
~ Lowered Poison Gas condensation point
|
||||
~ Acid will no longer destroy Chlorine
|
||||
~ Cyanide is now a liquid at room temperature
|
||||
~ Hid Cyanide
|
||||
+ Cyanide Gas, Cyanide Ice (Hidden)
|
||||
+ Neon Ice (Hidden)
|
||||
+ Ball recipe
|
||||
+ Rocket recipe
|
||||
+ Armageddon recipe
|
||||
+ Secret rare Ball Lightning
|
||||
[Bug Fixes]
|
||||
~ Fixed: Hardness does not resist explosion damage
|
||||
~ Fixed: E button (Element Select) doesn't change active category
|
||||
~ Fixed: Vines support themselves mid-air
|
||||
~ Fixed: Grapes break into yellow Juice
|
||||
~ Fixed: Game takes long to load on slow connections
|
||||
~ Fixed: Cursor box becomes thicker after drawing line
|
||||
~ Fixed: Flies make trees grow out of control
|
||||
~ Fixed: Dough and batter eat each other when mixing
|
||||
~ Fixed: Tadpoles, Slugs, Snails, Lichen, Dead Bugs, and Pollen drink all Pool Water
|
||||
~ Fixed: Roots turn Pool Water into Fiber
|
||||
~ Fixed: Cooldown not working when maximum cursor size is 1
|
||||
~ Fixed: Worms turn Plant and Evergreen to Roots
|
||||
[Technical]
|
||||
~ Optimized gas rendering
|
||||
~ Optimized fire somewhat
|
||||
+ SP behavior cell now works with "ignore" element property
|
||||
+ extraTempHigh and extraTempLow element properties (see Steam)
|
||||
+ canPlace element property, for tools that can also be placed
|
||||
|
||||
[Version 1.8 - March 17, 2023 - Cooking Update]
|
||||
+ Updated Donator list
|
||||
|
|
@ -184,7 +289,7 @@
|
|||
+ Fleas will eat Mercury and die
|
||||
+ Fleas will eat Ketchup to no dietary gain
|
||||
+ Salt Water kills Snails and Slugs
|
||||
+ Stinkbugs have a diet
|
||||
+ Stink Bugs have a diet
|
||||
+ Mercury dirties Water
|
||||
+ Water breaks down Mudstone
|
||||
+ Birds breathe Oxygen
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
6794
index.html
6794
index.html
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1 @@
|
|||
elements=3
|
||||
|
|
@ -30,6 +30,22 @@ elements.firefly.color = [
|
|||
"#310D09",
|
||||
"#310D09"
|
||||
];
|
||||
elements.firefly.tick = function(pixel) {
|
||||
if (!pixel.fff) {
|
||||
pixel.fff = Math.floor(Math.random() * 60) + 20;
|
||||
}
|
||||
if (pixelTicks % pixel.fff === 0) {
|
||||
pixel.color = pixelColorPick(pixel,"#d9d950")
|
||||
}
|
||||
else if (pixelTicks % pixel.fff === 2) {
|
||||
pixel.color = pixelColorPick(pixel,"#310D09");
|
||||
}
|
||||
behaviors.FLY(pixel,function(firefly,newfly){
|
||||
if (newfly) {
|
||||
newfly.fff = firefly.fff;
|
||||
}
|
||||
})
|
||||
},
|
||||
elements.human.color = [
|
||||
"#f5eac6",
|
||||
"#d4c594",
|
||||
|
|
@ -82,4 +98,6 @@ elements.epsom_salt.color = [
|
|||
"#f2f2f2",
|
||||
"#e0e0e0"
|
||||
];
|
||||
elements.flash.color = "#ffffa8"
|
||||
elements.flash.color = "#ffffa8";
|
||||
elements.bread.color = "#F2CF99";
|
||||
elements.mycelium.color = ["#734d5e","#b5949f","#734d53"];
|
||||
|
|
@ -95,6 +95,7 @@ kbd {
|
|||
padding: 10px;
|
||||
background-color: rgb(31, 31, 31);
|
||||
overflow-x: hidden;
|
||||
z-index: 10;
|
||||
}
|
||||
#infoSearch, #modManagerUrl {
|
||||
position: absolute;
|
||||
|
|
@ -109,6 +110,7 @@ kbd {
|
|||
font-size: 1.5em;
|
||||
padding: 8px;
|
||||
font-family: 'Press Start 2P';
|
||||
z-index: 11;
|
||||
}
|
||||
#infoSearch:focus, #modManagerUrl:focus {
|
||||
outline: none;
|
||||
|
|
@ -133,6 +135,7 @@ kbd {
|
|||
padding:5px;
|
||||
text-align:center;
|
||||
border: 1px solid #ffffff;
|
||||
z-index: 12;
|
||||
}
|
||||
.XButton:hover {
|
||||
background-color: rgb(200, 33, 33);
|
||||
|
|
@ -270,6 +273,9 @@ button, input[type="submit"], input[type="reset"] {
|
|||
#stat-pos, #stat-pixels, #stat-shift, #stat-tps, #stat-ticks, #stat-view {
|
||||
float:left;
|
||||
}
|
||||
#stat-view, #stat-element {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.categoryName {
|
||||
font-size: 0.75em;
|
||||
text-transform: uppercase;
|
||||
|
|
|
|||
Loading…
Reference in New Issue