first commit
This commit is contained in:
commit
768eed8787
5 changed files with 169 additions and 0 deletions
60
main.lua
Normal file
60
main.lua
Normal file
|
@ -0,0 +1,60 @@
|
|||
function love.load()
|
||||
local Button = require "button"
|
||||
|
||||
--movement keys
|
||||
movement = {}
|
||||
mL = Button(8, 27, 24, "a")
|
||||
mD = Button(62, 27, 24, "s")
|
||||
mR = Button(109, 53, 24, "d")
|
||||
mU = Button(127, 144, 30, "space")
|
||||
|
||||
--attack keys
|
||||
attack = {}
|
||||
bA = Button(159, 29, 24, "u")
|
||||
bB = Button(208, 8, 24, "i")
|
||||
bC = Button(262, 9, 24, "o")
|
||||
bD = Button(317, 16, 24, "p")
|
||||
bE = Button(155, 85, 24, "j")
|
||||
bF = Button(206, 64, 24, "k")
|
||||
bG = Button(262, 64, 24, "l")
|
||||
bH = Button(315,72, 24, ";")
|
||||
end
|
||||
|
||||
function love.update(dt)
|
||||
--movement keys
|
||||
mL:update(dt)
|
||||
mD:update(dt)
|
||||
mR:update(dt)
|
||||
mU:update(dt)
|
||||
|
||||
--attack keys
|
||||
bA:update(dt)
|
||||
bB:update(dt)
|
||||
bC:update(dt)
|
||||
bD:update(dt)
|
||||
bE:update(dt)
|
||||
bF:update(dt)
|
||||
bG:update(dt)
|
||||
bH:update(dt)
|
||||
end
|
||||
|
||||
function love.draw()
|
||||
|
||||
love.graphics.setBackgroundColor(1, 179/255, 102/255)
|
||||
|
||||
--movement keys
|
||||
mL:draw()
|
||||
mD:draw()
|
||||
mR:draw()
|
||||
mU:draw()
|
||||
|
||||
--attack keys
|
||||
bA:draw()
|
||||
bB:draw()
|
||||
bC:draw()
|
||||
bD:draw()
|
||||
bE:draw()
|
||||
bF:draw()
|
||||
bG:draw()
|
||||
bH:draw()
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue