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.
The sprites being animated was definitely not something I expected. Makes the whole thing feel a lot more alive all of a sudden.
I encourage everyone to also read the accompanying blog post linked in the OP. The paragraph about how I'm probably thinking that AI wrote the game for him really made me chuckle. That's exactly what I was thinking when I first read the blog title! Granted, it still would have been cool for a 9-year old, just not as cool as the alternative. So great job in immediately addressing this in the introduction. That seems like a really good use-case for AI (and I'm generally not the biggest fan of AI).
The "Dad's comments" throughout the post are also a great way of providing some additional context without editorializing the kid's own writing.
I was not expecting animations for v1 either! But one day he asked me what the extra buttons were in Piskel and I explained frames + layers. His eyes lit up and the flying snake was born an hour later. Originally with 4 frames, but mom gave him feedback that he needs more frames for it to be smooth. Thus I believe it is currently 8 frames!
And we have talked in depth about how not to use AI. He has a healthy mistrust of it because he's seen first hand how it hallucinates.
v2 has sounds, which got us into a long discussion around copyrights. He's recording his own! ;)
I will add this although it is well beyond the OP's child to fully understand... Congratulations on delivering something that people like!
Cheers ^_^
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.
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.
Or, something small and sneaky, like a pixel changing.
[Removes cloak]
On second thought, that would kill the charm of it.
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
Its great you have so many tools now to learn, and your parents to ask advice. Keep it up, programming is great fun. For me as a kid it was great way to learn and explore and create in a world where I didn't have much agency.
Regarding age, my buddy from college started learning to code when _he_ was 9, on BASIC, another old programming language.
If I can suggest some potential learning resources for when you really want to learn more about code, checkout https://mitp-content-server.mit.edu/books/content/sectbyfn/b.... SICP was fantastic for me. If you're stuck, take it as a learning opportunity, ask for help, and keep at it. If learning a new language is too much for you, see https://sicp.sourceacademy.org/ or search google for other various attempts to port the stuff from SICP to JS world. (note to parents: if you happen to be doing this, my advice would be to set up DrRacket and install the SICP language (https://docs.racket-lang.org/sicp-manual/index.html), also feel me to email me any q's, email address in bio)
This cannot be used to date you. Kids these days (and presumably anywhere in between) are still into pokemon. Just today it’s Koraidon and Miraidon.
If you look at the other pages on OP's website, they too are a Pokemon fan. :)
Do you have an opinion?
Oh wow, this reminded me... I was also ~12, maybe a bit younger, I don't know exactly.
I wanted to build my own Neopets, using Dreamweaver! I was making page after page, so I could link them together.
Stuff like: "home.html" -> "acara.html" -> "feed acara.html" -> "home after feed acara.html"... I didn't understand how people could make something like Neopets!?!
Luckly my older brother gave me some tips. But yeah, that started off my journey, as well as Game Maker!
I really don't buy that this was written/created by an actual 9yr old.
But this might just be my unhealthy pessimism/skepticism when it comes to stuff on the internet.
Both parents are programmers, and have also written blogs. While the motivation/drive is his own, he has helpful guidance to accomplish what he wants to do.
The blog is his own words. We helped with the outline, and also provided multiple rounds of feedback to ensure good clarity of what he's trying to express. We tried not to interfere too much with his thoughts. The quoted thought "because it was like a human, it could also be wrong like a human" is something he was telling us when he discovered it hallucinated. But he doesn't understand what an LLM hallucination is, that was his words. I asked him to share that in his blog post.
The code is written on his own. But when he gets stuck, he has us to give him hints. As programmers, we can speed up him significantly by steering him in the right direction.
I dunno if such skepticism is healthy or not, but looking at the source I feel that it contains too many things that need explaining to a 9yo: `DOCTYPE` and all those `META` tags correctly set when they make no difference to the game, why `box-sizing` has to be specified, all those different `display` attributes correctly set for the display that is needed for that element, what the `ease-in-out` means ...
And that's without even getting to the Javascript stuff, like why use const vs let, why use backticks and interpolation, things commented out temporarily instead of removed, the way the code is modularised, etc
In short, there are too many irrelevant-to-the-output best practices implemented that, I feel (after seeing what a lot of beginner/student programmers produce) demonstrates a level of experience that cannot come from "My First Game".
The signs of an experienced hand in the development is, to me, unmistakable.
We went through MANY iterations (test-play/code-review + feedback + dev) before it was released to the public, which meant there was a lot of discussions and lots of opportunities for him to correct many small issues.
Some thoughts:
* DOCTYPE & meta utf-8 - he learned from Khan academy
* meta viewport - I showed him how to test for mobile and pushed to make mobile a priority
* const/let/backticks - he uses prettier in VSCode, which does this automatically
* code modularization - as a result of discussions around maintainability
-- My son, 3.
– My granpa, 86
My son recently turned 8. All his coding so far has been with Scratch and other block-based programming environments (Octostudio, VEX Robotics, Apitor, Microsoft Makecode).
His typing speed is better than most kids his age, but still slow (around 10wpm).
I'm curious how you helped introduce your son to text-based programming. I've been considering either:
A) Having him go through this free Python course, that includes inline exercises: https://programming-24.mooc.fi/
OR
B) Having him create a web page in repl.it or similar.
He started with Scratch JR & Scratch.
Then we switched to Tynker Jr & Tynker. Which provide challenge oriented block based games. Teaches loops, functions, etc.
Then we switched to CodeMonkey, which provides challenge oriented block & code based games (coffeescript, python). Teaches variables, arrays, etc.
Then I felt there was not enough new learning from the above. So I gave him VSCode and had him go through Khan Academy's HTML lesson.
That's when he made a bunch of HTML pages you see: https://www.armaansahni.com/ (pokemon, bakis, etc). ALL the HTML/CSS on the site is hand written.
Then I wanted him to learn how to be resourceful... for this, I gave him a serious of small challenges (eg: "make a function that displays hello world on the screen") where he had to figure out the answer himself. Use Gemini or Google, etc. But don't ask me. He ended up learning how to use Gemini to accelerate his learning (see his blog post, he writes about it a bit) and he was submitting solutions to me in JS. He had prior Gemini experience because he was using it to create images, and JS was natural extension of HTML.
Then one day he decided he wanted to make a game that he had in his mind.
In this above process, I basically observed what he was learning and switched to apps where I felt he could still learn something new.
Additionally, I'm glad you weren't afraid to hand your son the real tools and let him build and break stuff. For some reason with programming, so much of the curriculum (even for adults) spends a lot of effort to hide away the things that are perceived as too difficult (e.g., pointers, memory allocation, etc). For children in particular it seems to be the actual code itself, and so we have things like scratch. It's quite refreshing to see a parent go against the grain on this one.
Your son has a seriously advantageous head start on life. Kudos!
Get him on gtypist for 20-30 min a day. It’ll pay dividends for life. You’ll be shocked how fast it gets up to 60+ wpm.
He only does 2-3 mins per day of focused typing practice. Most of his daily non-school study time is spent on math (Math Academy), Chinese (writing) and memorizing essential root words (using Anki). I don't want to add anything, as he already has little free time to play and read on weekdays.
Playing computer games (and then later programming with Logo and BASIC) is how I got introduced to computers. I too wanted to develop my own computer game when I was 8 year old. But unfortunately, I neither had access to enough time with computers nor did I have sufficient programming skills back then.
I did end up fulfilling my childhood dream of developing an invaders-like game 30 years later as an adult. I too chose to implement it using plain HTML and JavaScript. I have written more about it here: <https://github.com/susam/invaders#why>.
It is very heartwarming to see that we live in an era where computers are pervasive and a 9 year old can learn all this stuff from the World Wide Web and large language models, and then implement a fully functional computer game!
Technology is so accessible today - the limitation is only will and desire.
Actually we did start with Godot - but it was too much too fast and he was overwhelmed.
He mentions this in his blog post. So we ultimately stepped back and I wanted him to learn to be resourceful. I give him a series of small changes (eg: write a function in any language that displays "hello world" on the screen) and he delivered those results in JS (he already knew HTML/CSS at this point). The rest comes as a natural progression.
I guess in this case, the best and pragmatic option was to use what you know.
In the future, we'll try Godot again :)
I was 10 or 11 when I wrote my first (and only?) game, but A: it was dead simple, and B: I didn't have YouTube, Netflix, and an infinite variety of games a click away to distract me.
I'm impressed with any kids today that can withstand the siren call of distractions on the Internet. I doubt I'd even survive high school today.