39 lines
847 B
Lua
39 lines
847 B
Lua
-- debug --
|
|
-- if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
|
|
-- require("lldebugger").start()
|
|
-- end
|
|
|
|
-- libraries --
|
|
Object = require 'lib/classic/classic'
|
|
Baton = require 'lib/baton/baton'
|
|
Timer = require 'lib/hump/timer'
|
|
|
|
-- objects --
|
|
Healthbar = require 'obj/Healthbar'
|
|
|
|
function love.load()
|
|
input = Baton.new {
|
|
controls = {
|
|
left = {'key:left', 'key:a'},
|
|
right = {'key:right', 'key:d'},
|
|
up = {'key:up', 'key:w'},
|
|
down = {'key:down', 'key:s'},
|
|
action = {'key:z', 'key:space'}
|
|
},
|
|
pairs = {
|
|
move = {'left', 'right', 'up', 'down'}
|
|
}
|
|
}
|
|
timer = Timer()
|
|
health = Healthbar()
|
|
end
|
|
|
|
function love.update(dt)
|
|
input:update(dt)
|
|
timer:update(dt)
|
|
health:update(dt)
|
|
end
|
|
|
|
function love.draw()
|
|
health:draw()
|
|
end
|