Boilerplate for a Love2D Empty Game.
- anim8 - Spritesheet animation library.
- class - Class management.
- hump - Various Love2D helper classes.
- windfield - Game Physics Automation Library for Love2D.
- Simple-Tiled-Implementation - Tiled Map
- tween - Tween functions for lua.
- State Machine Management.
- Central Dependencies Management.
- Aspect Ratio management.
- This is already auto managed. Make reference to
BaseState.lua
andmain.lua
function love.draw()
-- Offset measurement
local xDiff = 0
local yDiff = 0
-- Center window graphics
if windowWidth > (minWidth * aspect_ratio.scale) then
xDiff = windowWidth - (minWidth * aspect_ratio.scale)
end
if windowHeight > (minHeight * aspect_ratio.scale) then
yDiff = windowHeight - (minHeight * aspect_ratio.scale)
end
love.graphics.translate(xDiff / 2, yDiff / 2)
-- Implement scale
love.graphics.scale(aspect_ratio.scale, aspect_ratio.scale)
end