I made a project template & toolset for folks familiar with the JavaScript ecosystem

Hey! I'm primarily a JS developer, so when I first got a look at the SDK, my natural impulse was to find a way to build games without leaving my comfort zone. To that end, I started looking at how to use npm scripts for building and previewing Playdate Lua SDK games.

Not long after my failed first attempt, @potch (creator of Smolitaire) had the same idea and shared his package.json file in the unofficial Playdate discord. I shamelessly pinched it and used it as a starting point to create my template.

All was going well until I checked out one of my projects on my PC (I spend 99% of my time on a Mac), and realised that my scripts weren't fit for purpose, so spent time supporting Windows and Linux. The result is an installable npm package, which I've called pddx (Playdate Developer Experience).

It does a bit more than hide away the detail of building & launching games (with a watcher that can run the whole shebang on every file change); have a peek through the docs and source to see what it's capable of. The most useful thing it does for me is generating declarative pdxinfo files, based on a combination of package configuration and deterministic build numbers. No more manual edits every time you want to cut a new release / beta!

To get people up and running as quickly as possible, I've also published a project generator to npm. This allows you to start a new project (without pre-installing anything) by typing:

npm create playdate

...into your terminal and answering a couple of questions. That'll give you a fresh project with a main.lua similar to the one depicted in the Lua SDK docs, and pddx built-in. It'll also check to see if you've installed the SDK already, and set the PATH environment variable on Windows (seeing as we still have to do that manually). Also, if you're using VS Code or Nova, you have the option of including useful defaults for those environments.

If you want to look at a project based on the template & tooling, I followed along with @SquidGodDev's recent Metroidvania video tutorial, and my resulting project is on GitHub.

I hope the tooling and/or template project are useful to some of you. I'd love your feedback about what you think works well, what's missing, and most importantly if it breaks for you! (please report bugs on GitHub)

4 Likes

Thanks for doing this!
The first template I've used was the github repo VSCode-PlaydateTemplate, but for some reason that didn't really work that smooth. I always had to open the main.lua file to make the build and send it to the simulator / playdate, and there it landed as main.pdx ... At this point I don't even know how to make a build for a release.

So with this setup it looks like it's a nice build piplline setup.

Any plans on creating something similar for C? (I guess not with node.js :slight_smile: )
I'm currently trying to get a setup for C, I found a repo to use but it crashed at the first point an image was set on a sprite :confused:

1 Like

@DomHaas I don't have any experience making games in C, so haven't looked into the tooling around it yet. It'd be pretty great if I could apply the same experience, but I'll have to get up to speed with the ecosystem first. Thanks for taking my tools for a spin!

1 Like