top | item 42312535

(no title)

wkyleg | 1 year ago

Amazing. Younger people (and people new in any field) often think of intersting approaches without the blessing/curse of "best practices." The process for creating the game was very good and very logical way to learn a new field.

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!

discuss

order

veesahni|1 year ago

Appreciate the feedback on the code style & variables. I raised this previously but perhaps external feedback will be what he needs to get him motivated to clean it up :)

WesleyJohnson|1 year ago

Agree 100%. Since dad helped, I was expecting to see sprites sheets, or some JS classes for some OOP, etc. Was pleasantly surprised to see how "simple" the approach was for such fun output with a decent amount of variety.

veesahni|1 year ago

He doesn't understand what a sprite is, or really the motivation behind sprite sheets. To him they're just animated images he made in a tool. Internally he switches the "costumes" of characters (terminology he got from Scratch I believe).

wkyleg|1 year ago

This is how cool new ideas arrive each generation