From dcfd1a410e668bcb82d114cd983ba40ad14186fe Mon Sep 17 00:00:00 2001 From: Rose Liverman Date: Tue, 21 Dec 2021 19:46:35 -0500 Subject: [PATCH] uhh grass --- src/World.moon | 3 +++ src/constants.moon | 2 +- src/main.moon | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/World.moon b/src/World.moon index 8c95aaa..81ae56c 100644 --- a/src/World.moon +++ b/src/World.moon @@ -2,6 +2,7 @@ import random, noise from love.math -- biomes = love.image.newImageData "biomes4.png" sands = love.image.newImageData "sands.png" +grass = love.image.newImageData "biomes4.png" colors = { {0.92, {0.7, 0.7, 1, 1}}, -- ice (mountain) @@ -43,6 +44,8 @@ class World if color[1] < value if color[1] == 0.65 -- sands value = { sands\getPixel 511, math.min 511, math.floor (math.min 1, (value - 0.65) * (1/0.03) + 0.5) * 512 } + elseif color[1] == 0.68 + value = { grass\getPixel 599, math.min 599, math.floor (math.min 1, (value - 0.68) * (1/0.03) + 0.5) * 600 } else value = color[2] break diff --git a/src/constants.moon b/src/constants.moon index 93efd7d..1931516 100644 --- a/src/constants.moon +++ b/src/constants.moon @@ -1,3 +1,3 @@ return { - tileSize: 20 + tileSize: 5 } diff --git a/src/main.moon b/src/main.moon index 513e491..5983edb 100644 --- a/src/main.moon +++ b/src/main.moon @@ -3,7 +3,7 @@ import tileSize from require "constants" w, h = love.graphics.getDimensions! screen = { w: math.floor(w/tileSize), h: math.floor(h/tileSize)} -debug = false +debug = true map = true Player = require "Player"