mirror of
https://github.com/usysrc/LICK.git
synced 2025-01-21 18:24:23 +00:00
feat: ✨ add divider module for visual separation in the game
This commit is contained in:
parent
e78556c5cd
commit
6a42aa4642
10
divider.lua
Normal file
10
divider.lua
Normal 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
|
6
main.lua
6
main.lua
@ -3,9 +3,8 @@
|
|||||||
--
|
--
|
||||||
|
|
||||||
local lick = require "lick"
|
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
|
lick.debug = true -- show debug messages in the console
|
||||||
|
|
||||||
-- A couple of shortcuts
|
-- A couple of shortcuts
|
||||||
@ -20,6 +19,7 @@ function love.update(dt)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function love.draw(dt)
|
function love.draw(dt)
|
||||||
|
lg.push()
|
||||||
lg.setBlendMode("alpha")
|
lg.setBlendMode("alpha")
|
||||||
lg.translate(lg.getWidth() / 2, lg.getHeight() / 2)
|
lg.translate(lg.getWidth() / 2, lg.getHeight() / 2)
|
||||||
lg.rotate(1 * pi * cos(time / 10))
|
lg.rotate(1 * pi * cos(time / 10))
|
||||||
@ -31,4 +31,6 @@ function love.draw(dt)
|
|||||||
300 * sin(i / 4 * pi + time / 10),
|
300 * sin(i / 4 * pi + time / 10),
|
||||||
200 * cos(i / 4 * pi + time / 5), 128)
|
200 * cos(i / 4 * pi + time / 5), 128)
|
||||||
end
|
end
|
||||||
|
lg.pop()
|
||||||
|
divider.draw()
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user