-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
226 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"Lua.diagnostics.globals": [ | ||
"this" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
local acidity = require("acidity") | ||
|
||
|
||
local map = acidity.new_map(10,64) | ||
|
||
local orig_line = love.graphics.line | ||
function love.graphics.line(x,y,x_,y_) | ||
orig_line(x+20,y+20,x_+20,y_+20) | ||
end | ||
local orig_points = love.graphics.points | ||
function love.graphics.points(x,y) | ||
orig_points(x+20,y+20) | ||
end | ||
local map = acidity.noise_map_complex(11,50,3,2,0.5) | ||
|
||
function love.load() | ||
love.graphics.setLineWidth(2) | ||
end | ||
|
||
function love.draw() | ||
for x=1,450 do | ||
for y=1,150 do | ||
local c = map:get_block(x,y) | ||
local w,h = love.graphics.getDimensions() | ||
|
||
local min = math.huge | ||
local max = -math.huge | ||
|
||
for x=1,w do | ||
for y=1,h do | ||
local c = map:get_point(x,y) | ||
max = math.max(max,c) | ||
min = math.min(min,c) | ||
love.graphics.setColor(c,c,c) | ||
love.graphics.points(x,y) | ||
end | ||
end | ||
|
||
love.graphics.setColor(1,0,0) | ||
--error(("%f:%f"):format(max,min)) | ||
|
||
--[[love.graphics.setColor(1,0,0) | ||
for x,ls in pairs(map.vector_grid) do | ||
x = x - 1 | ||
for y,vec in pairs(ls) do | ||
y = y - 1 | ||
local nx = x * 64 | ||
local ny = y * 64 | ||
local nx = x * 32 | ||
local ny = y * 32 | ||
local enx = x*64 + vec.x*15 | ||
local eny = y*64 + vec.y*15 | ||
local enx = x*32 + vec.x*15 | ||
local eny = y*32 + vec.y*15 | ||
love.graphics.line(nx,ny,enx,eny) | ||
end | ||
end | ||
end]] | ||
end |