How Leaderboards and a Pet Made My Kid Actually Want to Code
I tried sticker charts. I tried screen-time bribes. I tried "coding together as a special daddyβdaughter time." None of it lasted past week two. Then I added a leaderboard and a digital pet to the app, and my 7-year-old started asking to code at breakfast. Here's what worked β and what didn't.
If you are reading this, you have probably already done the hard part: convinced your kid that programming is something they want to try. The harder part is keeping that spark alive past the second week, when the novelty is gone and the syntax errors start.
I built BabyCode for my own kid, and I've been tracking her behavior β and the behavior of about 200 other kids who use the site β for the last 6 months. This is the post I wish someone had written for me at the start.
What didn't work for us
I burned three months on the wrong ideas. Here's the short version, in case it saves you the time.
1. Sticker charts
We had a wall. We had stickers shaped like dinosaurs. We had a rule: one sticker per completed level. After two weeks, my kid asked, "Can I just have the stickers without doing the levels?" Sticker charts work for things kids already want to do (brushing teeth, using the potty). Coding is a thing we have to sell. The sticker is the thing being sold, not the reward for the thing.
2. Screen-time trades
"If you finish 3 levels, you get 30 minutes of Minecraft." The deal was technically accepted. The execution was terrible. The 30 minutes of Minecraft would start, and my kid would do the levels as fast as humanly possible β skipping reading the explanations, copying the answer, and not retaining anything. We ended up rewarding finishing instead of learning.
3. Coding-as-bonding-time
The most painful one to give up. I genuinely love coding with her. But every time I sat next to her and said "ooh, what if we triedβ¦", I noticed the same thing: she stopped solving things on her own. She'd wait for my hint. The bonding was real, but the learning was gone. I had to step back.
The 3 things that actually worked
After all the failures, I rebuilt BabyCode around three specific features. None of them are original. All of them are pulled straight from games that already know how to keep 7-year-olds clicking. I just pointed them at code instead of coins.
1. A personal leaderboard (not a global one)
This was the biggest single change. I added a personal records page that shows only the kid's own history: their fastest typing speed, their highest accuracy, their quickest code clear time, their most-repeated level, and a timeline of records they've broken recently.
I deliberately did not add a global leaderboard. Here's why: a 7-year-old's fastest time is going to be slow. Comparing them to a 12-year-old is a recipe for shame. Comparing them to themselves last week is a recipe for pride.
The technical implementation is straightforward β see the /leaderboard page and the per-level rows. The interesting design choice is what to put on it. I included:
- Best WPM in the typing track
- Highest accuracy (with a β when they hit 100%)
- Quickest code clear time per level
- Most-repeated level (a stat kids love to brag about)
- A "this week I broke 4 records" card β recent, not all-time
- A "fresh records in the last 24 hours" badge on the per-level list, so the kid can see at a glance today's wins
The 24-hour badge is the unsung hero. My kid checks the leaderboard every day now β not because she has to, but because she wants to see if her β± time is still in the green. The "still in the green" is the trick: the badge disappears after 24 hours, which gives the next session a tiny, built-in reason to play.
2. A pet that levels up from real work
The pet is a tamagotchi. That's the whole idea. Each level the kid completes gives the pet XP. When the pet levels up, it gets a new emoji (egg β chick β cat β fox β dragon). When the pet levels up, a π confetti animation plays and a "level up!" toast appears.
The trick β and this took me four iterations to get right β is that the pet's XP must come from real learning work, not from clicking. If the kid could spam-click to level up the pet, the pet stops being a reward and starts being a Skinner-box. So the rule is:
- Earn XP by completing a level (5 XP per star)
- Earn bonus XP by breaking a personal record (15 XP per metric, on top of the star XP)
- Earn no XP from any other action
That second rule β the "record bonus" β is the link between the leaderboard and the pet. Beating your own time isn't just a line on a chart; it feeds the pet. Suddenly "I want to type faster" and "I want my dragon to evolve" are the same goal.
3. Visible "new-record" feedback at the moment of beating yourself
This was the third iteration's insight. The leaderboard was great for looking back. The pet was great for looking forward. What was missing was the in-the-moment feedback at the exact second a kid breaks their own record.
So when a level finishes with a new WPM, accuracy, or time, the app triggers three things simultaneously:
- π A "new record!" toast pops up with the metric and the new value
- π A short two-note sound plays (E6 β A6, ~200ms, distinct from the level-complete chime)
- β The timestamp on the leaderboard updates, so the next time the kid visits, the row is "fresh"
The combination matters. None of the three alone was enough. The toast without the sound was easy to miss. The sound without the toast was confusing. The toast + sound without the leaderboard update was a one-time high. The full stack turns a single moment into a memory the kid can revisit and try to recreate.
The data, 6 months in
BabyCode has been live since December 2025. I'm not going to pretend these are rigorous A/B test results β they're observational, and the sample size is small (~200 active kid accounts). But the trend lines are consistent enough that I trust them.
| Behavior | Before leaderboard + pet | After (6 months later) |
|---|---|---|
| Day 1 return rate | 58% | 72% |
| Day 7 return rate (came back a week later) | 11% | 34% |
| Median session length | 6 minutes | 14 minutes |
| Levels cleared per session (active kids) | 1.4 | 3.1 |
| Voluntary "I want to code" requests per week (parent-reported) | 0.4 | 2.8 |
The metric I'm proudest of is the last one. Parents tell me their kids now ask to code at unexpected times β in the morning before school, on the weekend, after homework. The "I want to code" is unprompted. That's the whole goal.
Why global leaderboards don't work for kids this age
I want to call this out, because every parents' WhatsApp group I am in eventually suggests "just add a global leaderboard, kids love competition." It's bad advice for 6β9 year olds. Here's the failure mode:
- Kid plays for the first time, sees the leaderboard
- Kid looks for themselves on it
- Kid is not on it (because no global leaderboard would show a kid with 3 levels cleared next to a kid with 200)
- Kid asks: "Why am I not on the list?"
- Parent: "You need to clear more levels first"
- Kid clears 10 more levels
- Kid is still not on the list, because the top 10 is full of repeat players
- Kid says: "I am never going to be on the list"
- Kid quits
A personal leaderboard doesn't have this failure mode. You are always on the list. You are always comparing to yourself. The whole game is "be a better version of you last week."
For older kids (11+) and tweens who have already developed a competitive streak, a global leaderboard is fine. Maybe even motivating. But the research on intrinsic vs extrinsic motivation (Deci & Ryan's self-determination theory, 1985) suggests that for the 6β10 age range, mastery goals (be better than I was) outperform performance goals (be better than others) almost every time.
What I'd do differently if I started over
Two regrets:
- I waited too long to add the pet. I thought gamification was a "nice to have." It turns out it's load-bearing. The pet is the thing that turns a level from "I have to do this" into "I want to do this so my dragon can evolve." I would have added the pet on day 1.
- I made the leaderboard too sparse at first. The first version had only 4 cards at the top. Kids didn't check it. When I added a "this week" stat and the 24-hour fresh-record badge, the daily-check rate went from 18% to 51%. Lesson: the leaderboard has to feel alive. If nothing has changed since last week, the kid has no reason to look.
Try it with your kid
If you want to see this in action, BabyCode is free β no account, no install, runs in the browser. Three tracks (typing 13 levels, Python 12 levels, C++ 7 levels), all bilingual (English / Chinese), and a personal leaderboard + pet on the records page.
If your kid has tried other coding sites and bounced, I'd genuinely like to hear whether the leaderboard approach works for them. Email or drop a comment in the community β I'm iterating on this in public.
About this site
BabyCode is a side project I've been running since December 2025 for my own 7-year-old. The data in this post is from real user accounts (with parents' consent). The site has no ads, no in-app purchases, and no tracking pixels. Learn more β
9 min read Β· 0 ads Β· 0 trackers Β· built by a parent for parents