Use own texture for example

Should run out-of-the-box without downloading any external images now.
This commit is contained in:
shylie 2025-07-16 13:36:42 -04:00
parent 9e6265d5bb
commit 5302e85988
2 changed files with 5 additions and 5 deletions

BIN
circle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

View File

@ -1,4 +1,4 @@
local tex = love.graphics.newImage("mrmo3x.png") local tex = love.graphics.newImage("circle.png")
tex:setFilter("nearest", "nearest") tex:setFilter("nearest", "nearest")
local function dirt_color(layer) local function dirt_color(layer)
@ -19,9 +19,9 @@ local function mountain_color(layer)
end end
end end
local BIG_BLOCK = love.graphics.newQuad(24 * 9, 24 * 9, 24, 24, tex) local BIG_BLOCK = love.graphics.newQuad(0, 0, 8, 8, tex)
local z = require("zprite").zchunk.new(tex, 384, 32) local z = require("zprite").zchunk.new(tex, 128, 32)
z._height_scale = 8 z._height_scale = 8
local function update_map() local function update_map()
@ -29,7 +29,7 @@ local function update_map()
for i = -64, 64 do for i = -64, 64 do
for j = -64, 64 do for j = -64, 64 do
local layers = love.math.simplexNoise(i * 0.02, j * 0.02) * 29 + 3 local layers = love.math.simplexNoise(i * 0.02, j * 0.02) * 29 + 3
z:put(i * 24, j * 24, BIG_BLOCK, math.floor(layers) + 1, layers < 23 and dirt_color or mountain_color) z:put(i * 8, j * 8, BIG_BLOCK, math.floor(layers) + 1, layers < 23 and dirt_color or mountain_color)
coroutine.yield() coroutine.yield()
end end
end end
@ -48,5 +48,5 @@ function love.update(dt)
end end
function love.draw() function love.draw()
z:draw(love.graphics.getWidth() / 2, love.graphics.getHeight() / 2 + 128, angle, 0.2, 0.2) z:draw(love.graphics.getWidth() / 2, love.graphics.getHeight() / 2 + 128, angle, 1, 1)
end end