Writing a book on coding games for Playdate with Lua

Hi there! I'm writing a book titled Make Games for Playdate with Lua that's about, you guessed it, coding games for Playdate in Lua using the Playdate SDK. :open_book:

Playdate Book Cover - Opt

It's currently in Early Access. I'm actively writing the book and am releasing it early so that I can get feedback from readers throughout. This is the book I wish I had when I started digging into making games with Playdate. I've written a couple of other technical programming books before, and I think the Playdate community would really benefit from having a comprehensive, beginner-focused book on how to get started.

Inside Playdate is absolutely an essential reference, but something a bit more guided will help get more people just started out into making games for Playdate. :heart:

You can get the book here:

There's a free sample available that includes the first three chapters! :nail_care: The web version of the sample can be read here.

Make Games for Playdate with Lua is primarily targeted at beginners with no experience writing code or making games. It covers the fundamental concepts of programming from functions to variables to tables to conditionals. If you're an experienced programmer looking to learn how to make games for Playdate, you'll fly through the book and find the examples of how to use the Playdate SDK helpful.

In each chapter you'll code a different small game, learning new concepts that build upon that last chapter. Throughout the chapters there are Bonus suggestions that encourage you to experiment and learn on your own.

All of the source is available on GitHub, broken down by section in each chapter:

Table of Contents

Here's what's completed and what's planned:

  1. Introduction :white_check_mark: — get yourself and your computer ready for making games for Playdate
  2. Hello, Playdate! :white_check_mark: — display text and move it around the screen
  3. Tennis :white_check_mark: — make a simple single-player Pong clone that uses the crank to move the paddle
  4. Clock :white_check_mark: — coding a simple clock app
  5. Snake :white_check_mark: — homage to the Nokia classic
  6. Flappy Crank :writing_hand:Flappy Bird but with the crank :crank:
  7. Crank Fishing :next_track_button: — making a silly little fishing game with the crank
  8. Sokoban :brain: — with level parsing from text files
  9. Simple Shoot 'Em Up :brain: — Inspired by Space Invaders
  10. Minimal Survivors :brain: — Inspired by Vampire Survivors
  11. Some kind of RPG or Roguelike :brain:
  12. Some kind of Platformer-y game :brain: — using Tiled or LDtk to build the levels

This is very subject to change, but I'm aiming for at least 10 chapters, with each chapter being its own project.

Topics covered so far:

  • Drawing text
  • Drawing shapes
  • Game loop
  • Screen positioning
  • Variables
  • Tables
  • Conditionals
  • Playing sounds with the MIDI synth
  • Player input with buttons and crank
  • Functions
  • Refactoring code
  • Save data
  • Adding a Playdate menu option

Topics I want to cover:

  • Drawing & animating sprites
  • Menus
  • Scene switching
  • Organizing code into multiple files
  • Playing music
  • Debugging code
  • Polish / juice

What's Next

I'm going to keep writing new chapters for the book! I've got a pretty clear sense of what I'd like to cover in the book. I'll post updates in this topic as I publish new chapters and have news to share.

If Make Games for Playdate with Lua is received well and there's interest, I'd like to record video versions of the chapters and explore making a print edition. Let me know what you'd like to see! Are there any specific topics you'd like to see covered or styles of game that'd be helpful to have explained in depth?

I'll post updates when new chapters are published or there's significant news with the project. Feel free to report any issues here. Thank you!

11 Likes

Yesterday I added and published a new chapter in the book called Clock :mantelpiece_clock: that goes over how to read the time from the system, respect user preferences for 24-Hour Time display, get battery percentage, and use a custom font!

I also figured out how to get nice looking gifs made using MP4 recording from the Simulator then converting with Gifski. :sparkles: Here's the crank-controlled paddle version of Tennis from chapter 2.

Playdate Tennis Demo

Next up is adding a chapter on coding Snake :snake: from scratch, including high score tracking (and reseting), scenes like main menu, and setting custom metadata for the game.

1 Like

The book has sold 6 copies in the first day of being on sale in Early Access. :tada: It's been neat seeing people being excited. I appreciate the support. I'll be as transparent as I can about the statistics and process of publishing the book alongside actually writing it. :smile:

My goal is to sell 100 copies within the first six months of it being available. I think that seems realistic!


Made good progress on the Snake :snake: chapter this evening. It reminds me how much fun Snake is to play while also being really beginner-friendly to make.

Hey there! Looking forward impatiently for it to be released, I'd be the first one (or one of the first ones if I don't get to the correct timing heh) in buying it no doubt! Keep up the good work man, I'll stay tuned!

1 Like

Thanks so much for your support!


Got some updates from about a week into the book being released in Early Access!

I just published a new version where I finished the first draft of the Snake chapter. Still a ton of fun to play. :snake: The new chapter covers a lot of topics: saving and loading high-score from the console, adding a menu option, advanced logic, loops, and working with nil.

Here's Snake in its minimalist glory:

Snake Demo

It was so easy to add a menu option to reset the high-score. The Playdate SDK being so friendly and simple really makes writing tutorials a joy. :heart:

Sales Update: The book has sold 26 copies so far. :tada: I wasn't expecting much at this point, so I am surprised and thrilled. It's been really motivating to see people excited about the book and supporting it. The feedback from r/PlaydateConsole and r/PlaydateDevelopers has been great.

Next up is Flappy Crank! :bird::crank: