From 5b9f2610224100a5a51c78e0fedf53c4e2f5317d Mon Sep 17 00:00:00 2001 From: Nekonico <163950752+DBNekonico@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:11:02 -0700 Subject: [PATCH] Color --- mods/genetics.js | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/mods/genetics.js b/mods/genetics.js index a6d633cd..dc2d8257 100644 --- a/mods/genetics.js +++ b/mods/genetics.js @@ -9,6 +9,77 @@ elements.organism = { age: 0 }, tick: function(pixel) { + if (pixel.vore === 0) { + if (Math.random() > 0.2) { + pixel.color = "#997457" + } + else if (Math.random() > 0.2) { + pixel.color = "#c4b270" + } + else if (Math.random() > 0.2) { + pixel.color = "#9c916a" + } + else if (Math.random() > 0.2) { + pixel.color = "#9e8955" + } + else { + pixel.color = "#a89a76" + } + } + else if (pixel.vore === 1) { + pixel.color = "#9E6954" + } + else if (pixel.vore === 2) { + pixel.color = "#A25F50" + } + else if (pixel.vore === 3) { + pixel.color = "#A7544D" + } + else if (pixel.vore === 4) { + pixel.color = "#A7544D" + } + else if (pixel.vore === 5) { + pixel.color = "#AC4A4A" + } + else if (pixel.vore === 6) { + pixel.color = "#B03F47" + } + else if (pixel.vore === 7) { + pixel.color = "#B53543" + } + else if (pixel.vore === 8) { + pixel.color = "#B92A40" + } + else if (pixel.vore > 8) { + pixel.color = "#BE203D" + } + else if (pixel.vore === -1) { + pixel.color = "#8B7C4F" + } + else if (pixel.vore === -2) { + pixel.color = "#7D8447" + } + else if (pixel.vore === -3) { + pixel.color = "#6F8C3F" + } + else if (pixel.vore === -4) { + pixel.color = "#619437" + } + else if (pixel.vore === -5) { + pixel.color = "#539C2F" + } + else if (pixel.vore === -6) { + pixel.color = "#46A428" + } + else if (pixel.vore === -7) { + pixel.color = "#38AC20" + } + else if (pixel.vore === -8) { + pixel.color = "#2AB418" + } + else if (pixel.vore < -8) { + pixel.color = "#1CBC10" + } if (pixel.geneticCode < 11) { if (isEmpty(pixel.x, pixel.y+1)) { movePixel(pixelMap[pixel.x][pixel.y], pixel.x, pixel.y+1);