Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Getting Started Writing a Game with Fennel and LÖVE

A topic by Alex ☕🇨🇦 created May 06, 2024 Views: 1,139 Replies: 4
Viewing posts 1 to 2
Submitted(+6)

It’s that time of year again! If anyone is interested in trying out love2d with Fennel check out the “minimal” love2d fennel repo.

This repo is slowly expanding from a truly minimal setup to one that comes with a few batteries included. If you want a bare bones setup to get you started check out: absolutely-minimal-love2d-fennel by @benthor.

If you want to just start coding up some fennel and love with no makefile or manual installation on linux check out love-fennel

Where to Start?

I highly recommend checking out the blog posts by Phil Hagelberg about his use of fennel for his 2018 submission Exo Encounter 667. The source for which can be found here

There is also a built in REPL on the languages home page that you can test out the language! https://fennel-lang.org/

Fennel now has a pretty decent language server in fennel-ls. Currently it does not have completions for love2d, however it works really well to jump to your own code points. I’d highly recommend checking it out!

Games Made Using Love2D and Fennel

By this point there have been dozens of games made with Love2D and Fennel, this is not an exhaustive list! If the source code is available for your game I can include it if you comment below.

Other resources:

Recommended Libraries

You don’t need any libraries to make a game! The ones mentioned here help solve specific problems.

Lume

https://github.com/rxi/lume

  • Provides functional style functions, e.g. reduce, map, etc.
  • Provides some nice to haves that are not available in the lua standard library like lerp and split (for spiting strings).

ANIM8

https://github.com/kikito/anim8

If you need sprite animation, check out ANIM8!

Bump

https://github.com/kikito/bump.lua

Bump is an axis aligned bounding box collider. It has a bunch of useful built in presets for triggering actions following collisions. If you’re writing a platformer (without ramps) I highly recommend bump!

Tiled

https://github.com/karai17/Simple-Tiled-Implementation

If you use want to use Tiled (https://mapeditor.org) check out the Simple Tiled Implementation! It works well with bump.

There are many more libraries! Any library that works with Love and lua will work with Love and fennel.

Submitted(+1)

woot woot!
this is my first game jam ever and my first time using a lisp dialect so I'm pretty excited :)
and I've played around with love2d with just lua before so this seems like a great entry point for me!
because of my I want to spend as little time setting up as possible, I'm just using the "absolutely-minimal-love2d-fennel"  with the vscode extension (my normal editor).

I'm on mac m1 so for formatting (not included with vscode extension ) I'm using the brew installation of  fnlfmt with this script:
```
find . -maxdepth 2 -name \*.fnl -exec fnlfmt --fix {} \;
```
it's not a great setup but it's "good enough"
havent totally figured out my submit build yet but my plan use love.js !  😎
hope it works!

Submitted(+1)

I used fennel/Love2D for my last game jam, there is a modification required to make the absolute minimum template work with love.js. You need to remove the extra thread listening on the terminal for input for the web / standalone binaries to work.

If you want to steal my export setup, here is the git repo to my entry this year, which has some niceties such as not needing to compile the fennel to Lua to make it run in love.js. 

Also, probably a bigger project than this jam allows, but consider emacs with fennel-mode for editing. It’s a first class experience and has everything baked in, even a REPL.

Submitted

awesome thanks for the share!

You can also replace {} with + for slighter efficiency!