started working on temperature range corrections

This commit is contained in:
2026-08-19 13:53:38 -06:00
parent c9a49eba48
commit 44e67966f0
4 changed files with 41 additions and 17 deletions
+8 -10
View File
@@ -8,6 +8,7 @@ local map
love.load = function()
map = map_generator.generate()
print("Temperature Range", map.temperature.min, map.temperature.max)
-- if true then return end
@@ -67,16 +68,13 @@ love.draw = function()
love.graphics.translate(window_width / 2 - (map.size * map.tile_size) / 2 - camera.x, window_height / 2 - (map.size * map.tile_size) / 2 - camera.y)
for x = 1, map.size do
if map.biome[x] then
for y = 1, map.size do
-- print(x, y) -- TEMP why am I getting an out of bounds?
-- local value = map.biome[x][y]
local value = map.temperature[x][y]
if value then
-- love.graphics.setColor(value)
love.graphics.setColor(value, 0, 0, 1)
love.graphics.rectangle("fill", x * map.tile_size, y * map.tile_size, map.tile_size, map.tile_size)
end
for y = 1, map.size do
-- local value = map.biome[x][y]
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.rectangle("fill", x * map.tile_size, y * map.tile_size, map.tile_size, map.tile_size)
end
end
end