e-ink

My Boox Tab Ultra C just arrived and I’m having a pretty good time with it already.

I took advantage of the “back to school” deal that included the keyboard cover.

Why not just use a laptop, you ask? Now I can sit in the backyard in direct sunlight and the e-ink display only makes the text more visible.

e-ink

It took some messing around to get set up the keyboard with a grave escape, but now that that’s done I pretty much have my beloved 60% layout. I’m using Termux to get me a *nix command line and from here I can SSH out to my stuff.

Obviously the Playdate dev work won’t be happening on this but so far writing this blog post in the backyard sun has been delightful and I am getting tons of sunlight.


Tuesday, August 08, 2023


Devlog - Pit Crew part 8

So I’ve finally gotten around to implementing a timer, which is sort of the point of this whole thing as the primary metric for scorekeeping. I’d been holding off on doing it because so till now I hadn’t had to do anything with dynamic text on the Playdate.

You get playdate.graphics.drawText() and not a whole lot else. If you just call that, you get this:

This happens because it’s just spitting the pixels out on the screen. What you need to do is clear them out for every frame and redraw it. There’s playdate.graphics.clear() but that clears the whole screen, which may include a good deal of pixels you don’t want to have to redraw.

This is the power of graphics.pushContext(). It’s weird how push and context together made no sense to me at first, but what is happening is that you’re switching the context of every graphics command to, for example, your sprite (by default, it’s the screen buffer itself). All of the x’s and y’s become relative to the origin of the sprite, and also, importantly, graphics.clear(). Now it only clears the bounding rectangle for the sprite you’re working on. When you’re done working in this context, you call popContext() and carry on.


Monday, July 24, 2023


Devlog - Pit Crew part 7

Now the cars have suspensions! Sort of.


Friday, July 21, 2023


Devlog - Pit Crew part 6

wc

This program is starting to get pretty big.

I have learned that the thing about sprites is that you need to clean them up yourself. I’ve gotten to a point where sideloading it into the physical Playdate is no longer a waste of time. The game actually feels pretty good to play but I noticed that after a while things got slower and slower. This was not a problem on the simulator because the simulator runs at your computer’s clock speed while the Playdate is much less powerful. Each car consisted of around 7 to 19 individual sprites (the car, two wheels, and the nuts on each wheel), and each time another car came in, the old one was still there off frame.

That was where I discovered that merely removing references to sprites was not enough to mark them for garbage collection. Internally, the Playdate was still tracking them off frame. You need to manually call sprite:remove() on them to remove them from the draw list.

This was a fun problem because my custom sprite objects had child sprites that also needed removing, so I had to override each object’s remove() function to cascade the removal all the way down to the nuts.

So now it’s running nice and smooth across both platforms. Next up, I need to figure out how text works so I can display a timer.


Thursday, July 20, 2023


Devlog - Pit Crew part 5

It’s kind of annoying when you need to rewrite your code, and in the end your program just looks the same (hopefully) for all the work you did.

At least I got to try making a git branch. Not many excuses to do so at this scale.

git pull

I swear, one of these days I’ll figure out what any of this means.


Sunday, July 16, 2023