feat: add divider module for visual separation in the game

This commit is contained in:
usysrc 2024-12-01 18:49:43 +01:00
parent e78556c5cd
commit 6a42aa4642
2 changed files with 14 additions and 2 deletions

10
divider.lua Normal file
View File

@ -0,0 +1,10 @@
local lg = love.graphics
local divider = {}
local width = 16
divider.draw = function()
lg.setColor(1,1,1)
lg.rectangle("fill", lg.getWidth()/2-width/2, 0, width, lg.getHeight())
end
return divider

View File

@ -3,9 +3,8 @@
--
local lick = require "lick"
local divider = require "divider"
lick.file = "main.lua" -- the file to watch for changes
lick.reset = true -- reload the whole game when a file is modified
lick.debug = true -- show debug messages in the console
-- A couple of shortcuts
@ -20,6 +19,7 @@ function love.update(dt)
end
function love.draw(dt)
lg.push()
lg.setBlendMode("alpha")
lg.translate(lg.getWidth() / 2, lg.getHeight() / 2)
lg.rotate(1 * pi * cos(time / 10))
@ -31,4 +31,6 @@ function love.draw(dt)
300 * sin(i / 4 * pi + time / 10),
200 * cos(i / 4 * pi + time / 5), 128)
end
lg.pop()
divider.draw()
end