Playdate Experiments (Alpha)

Here’s the weird word puzzle thing I’m making to help me learn Lua / Playdate.

Alpha

Three evenings work so far, it went something like:

Day 0 - Installed the SDK. Set up development environment in VSCode.
Day 1 - Pick from a dictionary of random words, one screen, 4 directional input. Learned: Drawing! File I/O! Fonts! Randomisation! Lua!
Day 2 - Multiple screens. Puzzle through the beginning of Moby Dick. Added a banner at the bottom to see the text as it is built. Learned: Animations! Dithering!
Day 3 - Use the crank to scroll the text at the bottom. History (go back if you keep pressing left). Learned: Crank input!

Kept up a nice pace but I’ve now got a nightmare code file with state all over the place so I think the next couple of days on this might just be tidying that up :grimacing:

Am also going to:

  • Try some OO (I miss it).
  • Look into unit testing so I have that in my tool belt.
  • Look at alternatives to direct drawing.

Good experiences:

  • Really quick to get going (development environment was easily the biggest pain, but thanks to Orta this was easy enough)
  • Way more examples than I expected! I started building out my drawing code from the pathfinder example.
  • Many of my questions quickly resolved by looking at the docs.

Bad experiences:

  • Getting to grips with tables and for loops.
  • Splitting strings :exploding_head:
  • Bit of a drag to get text centered vertically in a rect where horizontal alignment is handled.
  • Simulator hanging - I had non-terminating code, had to kill the simulator every time I tried it.

Having fun though :white_check_mark:

7 Likes

There are modules the can ease your table and string woes. Examples are underscore.lua and lume.lua

2 Likes

That’s really helpful, thanks! Any personal preference? They look similar for my purposes, and I lean towards Lume only because Underscore reminds me of past Javascript woes.

Yeah, I’m using Lume.

I had been using Underscore but Lume is more game focussed.

Not had too much time to work with Playdate this week but when I have it’s mostly been a case of refactoring: Breaking down the UI into screen elements, separating out model and view, and switching everything across to use the Playdate OO style.

I tried Lume and found it helpful but has a few weird omissions (e.g. split but no join?)

Right now I’m going to build out some structure around the puzzles, as I want to frame it as a conversation, and I’ll need an engine to support it. I’ll also start to look at draw efficiency and sprites.

Untitled

I’m getting tempted to try something more visually focused but holding off for now as I my attention span is my worst enemy sometimes!

4 Likes