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)