Features:
Example code:- Tab restarter.
- Hooks!
- Debug mode.
- Game state basics.
- Utility functions:
+ love.graphics.setDrawMode
+ love.graphics.setAlpha
+ table.Count
Code: Select all
require("tupbase.lua")
exl = {}
function load()
game.media = { cursor = love.graphics.newImage( "media/cursor.png" ) }
game.v.state = "menu"
end
function exl.draw()
if game.v.state == "menu" then
love.graphics.draw( game.media.cursor, love.mouse.getX(), love.mouse.getY() )
end
end
function exl.update(dt)
end
function exl.keypressed(key)
if key == love.key_escape then
hook.Call("beforeexit")
love.system.exit()
end
end
function nooo()
msg("Nooo don't exit! D:")
end
-- Add hooks.
hook.Add("draw", dfr.draw)
hook.Add("update", dfr.update)
hook.Add("keypressed", dfr.keypressed)
hook.Add("beforeexit", nooo)
Enjoy.