Lurker News
Hello, HN! Figure is a little side project I’ve been working on. Someone described it as Bejeweled meets Wordle.

I built the puzzle interface and website in Next.js and React, which was a first for me and overall a great learning experience. The daily puzzle data is queued up in a PostgreSQL table. Another table stores anonymous solve stats. Once a day, a cron job hits a serverless API that promotes the next puzzle as “live” and prompts Next.js to update the prebaked static site with the new data. The game state is managed with Redux and your stats are persisted to localStorage. Framer Motion for animations. Styling is mostly Tailwind CSS. I use Figma for design and Logic Pro to make the sounds.
I get a lot of questions about how the puzzles are generated. It’s not super sexy. I generate random grids of tiles and then run them through a brute force solver (sounds rough but the puzzles don’t feel anything). Every few days, I play through puzzles that look promising based on the solution space and pick some good ones to go into the queue. The rest are sent back to the void (again, painless).
I’ve spent a little bit of time tinkering with a procedural generator, but so far the random ones are better. The downsides of the random approach are (1) the curation effort required, and (2) the high variability in puzzle difficulty. I have a feeling there’s a whole body of math and CS knowledge where Figure is an example of something that I don’t know the name for (imposter syndrome intensifies).
As for the future of Figure, I feel strongly about keeping it free of ads, login walls, in-app purchases, or anything else that infringes on enjoyment or privacy. I’d also like to make sure Figure is accessible to everyone. English isn’t exactly required to play, but translations for the UI and website would be nice. I’ve tried to build Figure to be friendly to people who have color vision deficiency and people who rely on screen readers and keyboard navigation, but I have no idea if it’s actually any fun in these cases.
Here are some miscellaneous thoughts…
1. It’s been surprisingly satisfying to build a web game with a modern frontend stack. I’ve noticed a lot of grumbling on HN over the years from OG web developers who yearn for the days of semantic HTML, a sprinkling of CSS, and vanilla JS. I was in that boat too and have grumbled plenty about the breakneck pace of frontend evolution. One of my goals with this project was to pick some popular frameworks and give them an honest try. I’m now a believer, but there’s still no way I can keep up with all the progress.
2. I found Tailwind awkward at first, but after a while I realized I was using Figma a lot less and just designing in code with utility classes, which is great for focus and flow. Having lived through the Web 2.0 standards revolution, it was hard to let go of some deeply rooted opinions about semantic purity, but overall I’m sold.
3. I really love side projects. At most jobs, you’re pushed toward specialization. Side projects allow you to build out a generalist skillset, which makes you better at your core job function and better at collaborating with others. It’s also liberating to explore and pivot around without time pressure. Figure started out as a 3D fidget toy in Unity where you fling projectiles at floating objects…
4. I made this game on my trusty 2013 MacBook Pro, which has been almost completely sufficient (ahem Docker ಠ_ಠ). I’ll probably get an M2 Air soon, but I’m reluctant to say goodbye to the best computer I’ve ever owned.
5. I’m very grateful for the people who build and maintain open source projects. It’s also delightful how many paid services offer generous free tiers to let developers play around: Figma, GitHub, Vercel, Supabase, and Pipedream, just to name a few that I’m currently using actively. If you work on FOSS and/or these excellent platforms, thank you.
Anyway, hope you like it. Happy to answer any questions.

Comments (113) 34 threads

Earlier comments
bambax1 reply#
Good game, and great writeup. I'm clearly in the grumblers' camp but will try to take your example as an encouragement to move ahead.
sumul#
Give it a whirl! A couple early decisions I made about this that I think really helped: (1) Try to pick frameworks that have been fairly mature for at least a year or two. Even with stable stuff like React Hooks and Next.js I ran into issues that would have been much harder to figure out a year ago. (2) Set aside some time to learn but don't try to learn it all before starting to tinker. I spent about a week reading the official documentation for React, Redux, and Next.js, but it all really clicked in the first few days of building.
pelagic_sky#
I didn't really need another daily puzzle in my life, but at least this one looks great and has satisfying interactions. :)
hackerlight2 replies#
Amazing, but how can I play previous ones ??

I could sit here for an hour playing them but was done in a few minutes.

rsaz3 replies#
This is partially the point of the recent wave of daily games spurred by wordle. You can only play today’s puzzle, so you’ll have to return to the site every day to try new ones.

In fact I don’t think I’ve seen any that allow you to play past day’s puzzles.

hackerlight1 reply#
I don't see why this is a good feature for the user. I just want to play it.
rsaz2 replies#
It isn’t, it’s a feature to keep the website relevant for a longer time. I’d be really happy to see this one break the mold, considering the rest of the development seems really reasonable and user-friendly.

Continue this thread — 2 replies

brw#
I've been playing Cell Tower[1] for a while now, and it's one of the few that does allow you to redo previous puzzles you've missed (or have already taken and just want to redo anyway). The streak however only increases when you play today's puzzle.

[1] https://www.andrewt.net/puzzles/cell-tower

Kaibeezy#
There were a couple of sites that archive and let you play previous Wordle puzzles, unless NYT has lawyered them.
sumul1 reply#
Working on it!
hackerlight#
Thanks, I will bookmark it.
parasti1 reply#
I couldn't figure out how the game is supposed to be played. I clicked some squares and something happened, but what? Your help screen doesn't contain any information about this. Maybe it's obvious once you know it?
sumul1 reply#
Thanks for letting me know, and sorry if that was frustrating. Your goal is to clear away all the tiles. Tiles that are linked together clear together. Links are made when same-color tiles are contiguously adjacent to each other. Blank spaces are filled in from above. You have a fixed number of moves available to clear them all. Hope that helps!
bscphil1 reply#
1. I think giving a proper set of rules in the screen incorrectly titled "how to play" would help a lot. Currently it doesn't tell you how to play, it just says what the win conditions are: "Get rid of all of the tiles before running out of moves."

2. The animation is actually quite misleading, given the absence of rules. When you pick a tile from the bottom row, tiles that will be part of the new bottom row (or touching a tile on the new bottom row) become solid before they slide down to the bottom. (This may only be detectable on slow devices. Unfortunately, the animation for your game is extremely slow and janky on my Android phone from 2019.) This gives the impression that my touch has somehow transformed them, and I spent probably a dozen "games" frustratedly trying to figure out how they were being transformed before I realized that it was just a misleading animation.
IMO the way it should work is that the removed tiles should disappear, then all tiles should slide to the bottom, and only then should tiles newly located on the bottom become solid.

sumul#
That's really helpful, thank you. I'll see what I can do to optimize the animation performance more, and I'll take a closer look at the animation timing at lower frame rates. Definitely don't want to mislead or confuse!

Load more comments