a more reasonable temperature range to START from

This commit is contained in:
2026-08-19 17:17:37 -06:00
parent 44e67966f0
commit b3d8ca7f10
2 changed files with 20 additions and 74 deletions
+4 -1
View File
@@ -3,11 +3,14 @@ math.randomseed(os.time())
local map_generator = require "map_nextgen"
local lovebird = require "lib.lovebird"
local lume = require "lib.lume"
local simplex_map = require "lib.simplex_map"
local map
love.load = function()
map = map_generator.generate()
map.temperature.min = simplex_map.min(map.temperature)
map.temperature.max = simplex_map.max(map.temperature)
print("Temperature Range", map.temperature.min, map.temperature.max)
-- if true then return end
@@ -73,7 +76,7 @@ love.draw = function()
local value = map.temperature[x][y]
if value then
-- love.graphics.setColor(value)
love.graphics.setColor( (value + 89.2) / (89.2 + 56.7) , 0, 0, 1)
love.graphics.setColor( (value + map.temperature.max) / (map.temperature.max + math.abs(map.temperature.min)) , 0, 0, 1)
love.graphics.rectangle("fill", x * map.tile_size, y * map.tile_size, map.tile_size, map.tile_size)
end
end