Live data from Hacker News

My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback

armaansahni.com

371–380 of 493 posts

Re: My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback

#371
post #366

Seems very inspired by another game, Prodigy...

Yes, he was playing Prodigy in the months before he started making this game.

I suspect future versions will bring in mechanics from Minecraft and/or Factorio - things he's playing more these days.

Re: My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback

#372
post #64

Games are a series of interesting decisions. That’s one formulation. Being asked what x+y is with some graphics is not an interesting decision. Perhaps an interesting decision comes later, but I wasn’t interested and bounced.

A child can build a game that would be interesting to other children. If it's also interesting to an adult, that's a bonus, if anything. That said - thanks for checking it out :)

One of the hard things to do when building a game is to figure out why it's fun. It's hard enough that, in general, most folks just remake another game that's already figured out the fun.

You're doing a math game, math gamified. Let's throw a choice in there.

Since you replied, here's one idea:

(1) present five numbers. (2) You, the player, chose two numbers (3) You perform an operation (3.1) operation: add/subtract/multiply/divide, but perhaps exponentiation and modulo and lcm and factorize and whatever else. it's probably best to keep it simple. (3.1.1) this can get random: what was the highest number last round? how many green letters are there on the screen? (3.2) operations are tied to the special attacks,eg tier 1 attacks are add/subtract, tier 2 mult/div, and so on. (4) you type in your answer (5) if you type in an answer that's the correct result of an operation applied to two of the numbers, then you do the corresponding attack.

So it's not add these two numbers pass/fail. It's you decide what math you want to do, and can do, and can do in a time limit, and that achieves the effect you're looking for.

Anyways, it's always fun to make a thing.

Re: My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback

#373
I'm sure you've gotten a lot of good feedback, but a personal message for your kid: I am well into my adulthood, but I started programming from a similar place way back when. I was probably 12-13 when I was self-studying HTML/CSS/JavaScript. Today the web tech stack is way more complicated than it was when I was a kid, but its also way more capable. You can do so much with it now that was a dream - I was into pokemon as a kid and wanted to make a "fan site", which is what got me learning (just to date how far back this was)!

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)

Re: My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback

#374
I've been writing JavaScript since I was about your son's age and am now one of the editors of the JavaScript specification. His code is much much better than mine was at his age!

I have one piece of feedback for him about the code itself, in case he's interested (of course the important part is the game, not the code, but I'm more qualified to give feedback on the JS): put `"use strict"` at the top of every .

Re: My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback

#375
This is incredible. Nice work kiddo!

A couple of things I think would make the game a bit smoother are: - Feedback on the charging status, so I could more easily tell when I can use a move - Move the math prompt out of a modal if you can, and into the window, or something where I can click the answer

Keep it up!

Re: My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback

#376
Congrats kid! It's a fun app incorporating strategic and visual play. The code is well structured and clean.

`onclick` handlers inline are a great way to get going with interactivity. One possible improvement could be to add event listeners dynamically after `load`.

Another challenge might be to move stuff outside of the global namespace, especially variables. For a challenge and possible improvement, see if you can implement a Singleton pattern.

Start practicing now with inline comments. In HTML and in JS. Build that as a good habit early -- it will save you and those around you countless hours in the future.

Re: My son (9 yrs old) used plain JavaScript to make a game, and wants your feedback

#380
post #57

Earlier quoted context omitted.

Yeah, I was having the same issue. I couldn't tell why the weapon was not charged up. But sometimes on the second click it would work. But well done!

I think there are two improvement requests here: 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

> tiny dev

This has me dead. To the kiddo: great work, this is an amazing start.

Post reply on HN