Toybox Math: Building a Camera Math Game for a Hackathon

Toybox Math: Building a Camera Math Game for a Hackathon

12 November 2026

Toybox Math started as a hackathon project and turned into the clearest lesson I have learned about building for kids: if the camera miscounts a pile of blocks, the math is wrong, and the kid notices first. Everything else in the game follows from that.

The project was my entry for the Meta Global AI Developer Hackathon, a remote event run by Cerebral Valley. I built it between October 27 and November 4, and submitted it before the November 4, 6 PM deadline. It did not place in the judged awards, out of 5,367 projects. The 10,000 dollar Community Vote is still open, with the winner announced Monday, November 16. But the build itself was the point, and it taught me more than the result did.

What we cover

  • The concept: a stuffed animal becomes the avatar
  • Ratio practice with real objects
  • The hard lesson: segment and count, then verify
  • What the camera modes do
  • What happens next

The concept: a stuffed animal becomes the avatar

Toybox Math is a standalone camera math game in the style of Math Buddies, not a Math Buddies mode. You take a photo of a stuffed animal, and it becomes your avatar. The cutout uses Meta's SAM model, so the stuffy gets separated cleanly from the background and shows up in the game as your character.

That first step matters more than it sounds. The game starts with something the kid already loves, sitting on their bed. The avatar is not a generic character. It is their bear, their dinosaur, their whatever. The repo is public if you want to see how it is put together: toybox-math on GitHub.

My daughters are the QA team for Math Buddies, and the family build sessions are how these games get shaped. I wrote about that process here: Building Math Buddies With My Daughters as QA. Toybox got the same treatment: if the kids do not get it in a minute, it is not ready.

Ratio practice with real objects

The core game is ratio practice. SAM counts real objects in the camera view, and the kid sorts them into ratio boxes. Three red blocks and two blue blocks is a ratio, and the game asks the kid to make it, check it, and fix it.

Ratio first was a deliberate decision. It is concrete, it is visual, and it works with physical objects a kid can touch. The progression came next: a rescue quest that gets the first stuffy into the game fast, plus accessories to earn. The rule was that the first stuffy had to be fast. A kid should not sit through setup before the fun starts.

The hard lesson: segment and count, then verify

Here is the lesson. SAM is good at cutting out objects, and it is good at counting them, but good is not perfect. If the camera miscounts a pile of blocks, the math is wrong. The ratio the game shows does not match the ratio on the table, and the kid notices immediately. Kids are ruthless QA on exactly this kind of thing.

So the method is scan, then verify. The game shows what it counted and asks the kid to confirm before the math starts. That extra step feels like a delay, but it is the whole game. A math game that gets the count wrong is not a math game. It is a broken toy.

This is the same lesson I keep learning on every camera project: the model is the easy part. The trust is the hard part. You earn it by showing your work and letting the player correct you.

What the camera modes do

Beyond ratio, the same segment and count pipeline powers a set of extra camera modes: Show me, Build the number, Sort by color and size, Balance sides, Estimation jar, and Pattern copy. Each one reuses the same idea: point the camera at real things, count them, and do math with the count.

They are not all built yet. Ratio is the game. The rest are the roadmap, and they exist because the pipeline is the same. Once the counting is trustworthy, the modes are cheap to add.

What happens next

The hackathon is over, the judging is done, and the Community Vote closes November 16. Win or lose, the game is a real thing now, and the next step is the same as every other project I build: put it in front of kids, watch where they get stuck, and fix that first.

The demo video is three minutes, and it shows the whole loop: photo, avatar, count, ratio. If you build camera games for kids, the one thing I would steal from this project is the verify step. Show the count. Let the kid correct it. Everything else follows.

Final thoughts

Toybox Math did not win the hackathon. It did something better: it proved the pipeline works and found the one rule that matters. The camera can count, but the kid decides whether the count is right.

The short version: a stuffed animal becomes the avatar, the camera counts real objects, and the math is only as good as the count, so the game shows its work and lets the kid verify it.

/blog/2026-11/toybox-math-building-camera-math-game-hackathon austin.amento.dev