Skip to content
LOVE2D game template
Branch: master
Clone or download
Latest commit 25df8ec Mar 12, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is a LOVE2D game template. It contains:

  • A "fixed" framerate setup
  • A sprite system
  • A palette system (comes loaded with DB-16)
  • A resource system
  • A basic logging function
  • An 8-bit color-depth patch (CINDY))
  • A pixel-like font (Pixellari by Zacchary Dempsey-Plante)

I made it for a Work-In-Progress workshop I'm working on based around making retro-esque games using LOVE2D and Piskel.

To add code, edit src/code.lua.

  • code.init -> love.load
  • code.update -> love.update
  • code.draw -> love.draw

To adjust the framerate, edit t.framerate in src/conf.lua. (Default is 30FPS)

Helper Functions

Global Functions

  • seconds(x) - gives the amount of update frames that fill x seconds
  • drawCentered(drawable,x,y,scale,xCentered=true,yCentered=false) - Draws drawable at (x,y), but centered in the x (xCentered) and/or y (yCentered) dimensions
  • prepForImage() - sets foreground color to pure white, so as not to distort the colors in the image
  • log(message,prefix="") - logs message as coming from the function. (if function should have a prefix (i.e; code.init), supply prefix.)

res - Resources


To add resources to the list, edit res/index.lua. The format:


For an example, see the included font listing.


  • res.get(resource_name,arg=nil) - Gets resource_name, with secondary argument arg.

For font resources, arg defaults to 16.

palette - Palette library

  • palette.register(name,colors) - Registers palette name, with colors colors. For example, this is the included DB-16 registration:
  • palette.getPalette(name) - Gets pre-registered palette name.

Config variable t.palette chooses which of the pre-registered palettes will be used on startup.

You can’t perform that action at this time.