Use own texture for example
Should run out-of-the-box without downloading any external images now.
This commit is contained in:
parent
9e6265d5bb
commit
5302e85988
BIN
circle.png
Normal file
BIN
circle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 124 B |
10
main.lua
10
main.lua
@ -1,4 +1,4 @@
|
||||
local tex = love.graphics.newImage("mrmo3x.png")
|
||||
local tex = love.graphics.newImage("circle.png")
|
||||
tex:setFilter("nearest", "nearest")
|
||||
|
||||
local function dirt_color(layer)
|
||||
@ -19,9 +19,9 @@ local function mountain_color(layer)
|
||||
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
|
||||
|
||||
local function update_map()
|
||||
@ -29,7 +29,7 @@ local function update_map()
|
||||
for i = -64, 64 do
|
||||
for j = -64, 64 do
|
||||
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()
|
||||
end
|
||||
end
|
||||
@ -48,5 +48,5 @@ function love.update(dt)
|
||||
end
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user