My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback (armaansahni.com)
Recently, we had a breakthrough where he learned how to leverage Google Gemini as a learning tool (not to write code for him, but as a better search and as a coding teacher). This leveled him up big time and he decided to make his own game.
Game link here: https://www.armaansahni.com/game/
He's coded all the HTML, CSS & JS by hand in VSCode. He's made the animated graphics on his own using a web based sprite editor called Piskel.
For the game, I provided hints along the way and Gemini has helped him with syntax. View source to see the code. He's excited to share with the community.
He also wrote a blog post about how he made this game: https://www.armaansahni.com/how-i-coded-a-game-using-ai/ (he independently figured out how to leverage Gemini effectively and writes about it here).
Regarding the blog post - We had a discussion about who the target audience is (ie not 9 year olds!), what they would be interested in learning about and the general outline. He then dictated his words into the computer (which gets around spelling issues), and he went through multiple rounds of feedback from his parents (improving clarity, punctuation, etc). In other words, its his words & thoughts but he had help along the way!
NOTE: both parents are programmers, who provided valuable guidance through his coding journey.
492 comments
[ 2439 ms ] story [ 1939 ms ] threadBe fun to add some music to this.
In terms of constructive feedback: I would like to know when the various weapons are "charged." It doesn't seem like we can tell from looking.
Also it might be interesting to see what question the opponent is working on and what his answer is.
But well done!
1. Dont't allow button clicking when not the player's turn (expect tiny dev might be getting tripped up by async event handlers here)
2. Visually flag whether or not an ability is charged
Appreciate the feedback!
"Sorry, you have to branch first."
"Sorry, you have to submit a pull request."
"Did you complete your peer code review?"
"Did you close the associated Jira tickets?"
"Did this pass your test harness?"
"Are you having this built and tested by your CICD bot?"
"... is this project's architecture even approved? Sorry, you need to submit this to the architectural review board. They meet once a month."
Come to think of it, I'm now recognizing why coding used to be more fun.
For this version, I stopped at "does it work? alright, move forward"
This has me dead. To the kiddo: great work, this is an amazing start.
if you use the throwing star multiple times, it charges up other ones. But if you use another one, then you have to charge it up again. I believe 4 throwing stars give you the exploding star!
I think it might just be doing random choice when it's clicked. I found that if you get the "it's charging" message, you can just click again & again & eventually one of them will go through.
Edit: I think the "charge" is earned when the enemy move is completed, but the logic is buggy. Pretty fun first game nevertheless.
Or, something small and sneaky, like a pixel changing.
[Removes cloak]
On second thought, that would kill the charm of it.
Appreciate the feedback
Also 32x32 limited reduces complexity a lot when trying to make a visual.
Then one day I explained how the animation worked in the Piskel app (it had layers and frames). I came back an hour later and he had that flying snake that absolutely blew me away. He originally had it at 4 frames we gave him feedback that he needs more frames to be smooth. He upped it to 8.
The graphics is where had the least guidance from parents. We were focused on the code/logic aspects.
So my guidance was more of a set of hints as needed, for example "you want to boxes side by side, figure out how to do that using CSS" .. then he'd go away and talk to Gemini and ultimately Gemini would give him multiple approaches that he could try.
When it came to animation, I explained that there are many ways to animate (CSS, JS, etc) and guided him towards animated images. Basically, we "chatted" about a feature, I gave him some hints, then he went off and talked to Gemini for syntax and wrote the code. Many features he knew exactly what to do. If he wasn't sure, he'd have a discussion with me.
Basically, I was like a senior dev sounding board. He was the junior developer doing the work. Gemini was his Google/StackOverflow.
But OP has clearly put a lot of effort in and still gotten not-great results because they aren't making use of more modern tooling (game engines etc) to turn each hour of effort into more productivity.
Children do not need to "turn each hour of effort into more productivity". They need to learn stuff (and feel good about their learning, so they keep doing it).
Keep it up! Just don’t add micro-transactions :P
Echoing the other comment - as a tired dad, I struggle with the Math questions :)
As a programmer, I'm surprised - I can say a few words (eg: "look into css background styles") and he can say it to Gemini and slowly figure out stuff on his own.
As a test player of this game - I don't want to think so much, but if it means he'll learn some math in the process, I'll do it. :)
We've talked about using a visual indicator, perhaps greying out uncharged attacks.
I would recommend a couple of small things for the code. Variable names are usually ALL_CAPS if they never change (for instance const PI =3.142) and camelCaseForOtherVariables. snake_case_variables aren't really used in JavaScript, but aren't technically wrong. Also, it's usually good to put variables into nested data structures with hashmaps instead of comparing based upon array index. This is in "the real world" though, in academic computer science algorithms based on position in lists are more common.
If you want to get what we call "Code Review" a good way would be to feed your source code into a LLM to have the LLM give feedback based on your code, and recommend improvements. Most people like Claude best for dealing with code nowadays.
I would also recommend putting your code on Github so that people can check it out.
Very impressive!
What this 9-year old did is different. Maybe it’s a modest game, but they used an LLM as a tool to learn to code, not just to produce AI slop.
It feels crummy that you’ve taken a thread that is about celebrating a kid’s first achievement in creating a game and made it about promoting your gamified app which appears to celebrate everything that is wrong with modern games.
Newsletter was added after people on reddit asked about how they can be notified for v2 of the game :) - I had to help him with the newsletter integration.
As a parent, is fame really something you want for him?
The feedback received has been incredibly valuable. Not just for improving the game, but also for sparking conversations at home about game mechanics, color balance, coding standards, and even broader concepts like design and flow.
Ultimately, I'm showing him how we do things in the real world - build it, write about it, make sense of the feedback, and iterate.
Btw, this game reminds me of BBS door games. Great stuff.