An equation plotter you can pan and zoom around with on a touchscreen.
Adaptive ticks on the axes are extremely satisfying.
Unfortunately the size of the program goes from 90 to 150 lines. (200 lines is about the limit Carousel can comfortably handle on a phone, so I've been trying to adopt that creative constraint, even though these videos are taken on a tablet.)
It's been a while since I showed it here, so to recap, this is how my programming environment has looked for most of 2023. It's an infinite surface where you can move each top-level definition independently of the others.
Using it revealed one problem: sometimes definitions would overlap. If the move bar is occluded, I need to move other nodes to find it.
I mulled it over while resisting the urge to build a window manager.
Using this revealed a new problem: it was hard to move one definition around another. More broadly, my UI -- where things mostly stay fixed unless you move them -- now seemed a lot less calm.
Yesterday I made 2 tweaks, and now things seem pretty decent again. This took 30LoC:
Resolve collisions only at the end of a drag. Now moving seems to lift the definition above the surface and set it down at its destination.
During the drag I show a shadow where any other definitions would get nudged out.
Dropping near the original place resolves no collisions. This lets me change my mind after starting a move. A shadow at the original location helps me give up.
A voice recorder you can tweak the source code for, right on your Android phone
One little detail here involves Android permissions. I almost ended up asking for microphone permissions in Lua Carousel. Luckily I managed to stop and ask myself what the user experience is. "Hi, I'm Lua Carousel, could I please have access to your mic?" Ick! It seems like a bad idea to ask for a permission for the whole app just in case some single script uses it. Probably affects the conversions from this particular blog post, but I don't want to feel like I'm contributing to the general fatigue over apps asking for permissions. :shrug:
One nice reusable abstraction my LÖVE apps have all converged on is an immediate-mode button primitive. I draw all my buttons each frame along with all the callbacks they need, and a couple of framework-y lines of code in the mouse-press callback is all it takes to get them working. Last night I realized (while poking around in the LÖVE forums) that my hacky sliders in Lua Carousel's settings admit a similar abstraction (even better than the one there). The only additional complexity is it needs a couple more lines in the update callback that continually refresh the backing value as you drag the slider.
The Game of Life is one of my favorite programs, but I've never tried to go deep in learning about it, and as a result I still learn fairly obvious (with hindsight) things about it. This time I realized two things:
I don't need to keep checking if a cell is in bounds. Just don't update a border of cells!
I don't need to clean up the new array at each time step! :facepalm:
spell-cards.love (exercising my phone's microphone for the first time)
Both qualified successes. I didn't uncover any bugs, but the programs were 250 and 350 lines long, which starts to feel too long for my implementation of scrollbars.