Skip to main content

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

Preparations - Building Fennel for Playdate

A topic by therabidbanana created Sep 27, 2023 Views: 292 Replies: 2
Viewing posts 1 to 3
Submitted(+4)

For this game jam I’m planning on building a game for the Playdate console. I ordered these nearly a year ago and finally got them a couple weeks ago. I’ve been itching for a reason to use the free SDK, which is all Lua based (and therefore should be easy to use Fennel with!)

I worked out a bit of a build process to precompile Fennel to Lua before running it through their compiler and I plan to spend the next couple weeks building a small framework with it so I have a decent starting point. 

If anyone else is interested in making a 1bit game I’m happy to share the code after doing a bit more cleanup!

The trickiest part to get started has been that Playdate Lua does not have a “require”, so I’ve had to improvise my own runtime require (& preload table) so that the fennel compiler (with require-as-include option) can have access to it. It’s a bit ugly but gets the job done as long as you don’t care too much about relative paths!

Submitted

My starter repo is now uploaded to Github.  

The magic that I spent most of my time on fiddling with is in the require replacement:

https://github.com/therabidbanana/playdate-fennel-starter/blob/main/source/main....


I also set was able to figure out how to handle the import statements Playdate lua used via a macro for pd/import from this comment:

https://github.com/bakpakin/Fennel/issues/421#issuecomment-1103070078

Submitted

Over the weekend I started investigating how to easily build a tilemap. There's a pretty nifty tool called LDtk that is freely available (pay what you want) and outputs a documented JSON file for building levels out of tiles. There is an available Playdate library for importing LDtk files into Playdate but I wanted to keep the project light on external dependencies so I decided to start my own!

I wrote two variants, one for loading the files on the fly, and another using a macro to preprocess the JSON and store it in an easier to use format for when the scene loads https://github.com/therabidbanana/playdate-fennel-starter/commit/2eae73419f9c7f7...