The Autumn lisp game jam is almost upon us! Today, its wonderful to see so many lisp dialects and a game frameworks available to use to make games :) This is a far cry from the first jam in 2016.
As always, I am here to evangelize making games with Fennel, a lispy lua, and Love 2d.
I was inspired to start making games with Fennel and Love after reading @technomancy’s 2018 exo encounter devlog, which outlined how to get up and running developing a game interactively with Fennel. If you’d like get started check out the “minimal” love2d fennel template.
The template provides a repl you can use to modify your running environment, and hotload modules that have been modified. Note, careful state management is required when hotloading. Make sure any state you wish to persist is stored outside of the module you are reloading. Feel free to reach out it you have any questions about setting up your game to work interactively.
If you’re just getting started with fennel, but are familiar with lua, the fennel reference is a great place to start. Even if you’re not familiar with lua, (I wasn’t when I started) the language is concise enough to pick up in a weekend! There are also a collection of example codebases to help you get started.
Love 2d is a great framework to get started in. The wiki provides lots of useful examples to get you started, and there are numerous libraries available to help with the game dev process. Some of my favorites are bump, anim8, gamestate and lume.
If you’re brave you can also try targeting the web. The “minimal” love2d fennel template has a “web” target that may be used in the makefile. Note that desktop love 2d relies on luajit. The core of luajit is assembly, which cannot be ported through emscripted to the web. Instead we rely on Lua PUC 5.1, which has some subtle but significant differences in behavior. There are numerous other small gatchas when porting to the web. Make sure you load assets statically rather than streaming them, and avoid the use of threads.
If you’d like to do web first development to avoid fixing these gatchas at the last minute check out the fennel lovejs template. This template has built in support for using both Lua5.1 and Lua5.4 (I’d recommend using Lua 5.4). It lets you both build a single html file that may be hosted and to run a shell/repl so you can interactively modify your running game. It also incorporates a Linux build of Love2d compiled to work with Lua 5.4 that can be used for local testing and for desktop distribution.
Here is a small snippet to show how easy it is to get up and running with love2d and fennel. Happy Jamming!
(var time 0) 
(local display-string "Time since last click: %d")
 
(local font (love.graphics.newFont 30))
(fn love.update [dt]
  (set time (+ time dt)))
  
(fn love.draw []
  (love.graphics.setFont font)
  (love.graphics.print (display-string:format time) 10 10))
  
(fn love.mousepressed [_button _x y]
  (set time 0))