Show HN: I taught my little brother JS, and he made this videogame in a week
241–250 of 285 posts
Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#242Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#243Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#244Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#245Look at the code guys [1]. I love it. This is simple. There is not a single line of bullshit. I hope he gonna become a great programmer and continue to make beautiful code like that. [1] https://github.com/S-poony/Ultra-Square-Catcher-USC-/blob/ma...
But what if he wanted to turn it into a AAA FPS game with RTS elements in a persistent online world that supports millions of simultaneous users?
Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#246Earlier quoted context omitted.
I do agree it’s a complaint about the language. However, I think it does ultimately fall on the developer to know how to work with the language including the bad/ugly/awful parts. I also think not polluting the global scope is a pretty foundational thing to know or be aware of. It’s really easy to shoot yourself in the foot or have naming collisions/overwrites happen if you aren’t careful. Another example would be me…
> However, I think it does ultimately fall on the developer to know... This person has been programming for a week. I think we can let this slide
Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#247Earlier quoted context omitted.
I do agree it’s a complaint about the language. However, I think it does ultimately fall on the developer to know how to work with the language including the bad/ugly/awful parts. I also think not polluting the global scope is a pretty foundational thing to know or be aware of. It’s really easy to shoot yourself in the foot or have naming collisions/overwrites happen if you aren’t careful. Another example would be me…
> However, I think it does ultimately fall on the developer to know... This person has been programming for a week. I think we can let this slide
Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#248Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#249Earlier quoted context omitted.
Really well done and I like the brevity. Here are some ideas for revising the code: 1. There are two functions called "distance" and they're identical. Only the outermost appears to be needed. 2. As written, the game places variable and function names into the global scope. It doesn't matter for this game, but will be a problem for larger games. One idea would be to use the Immediately Invoked Function Expression (II…
Also never use Math.pow for squaring numbers (used in the distance function) because it is significantly slower as it is designed for abitrary real exponents, not just integer ones. Cannot be learned soon enough IMO :) Still a very good job for just a week of coding though.
Re: Show HN: I taught my little brother JS, and he made this videogame in a week
#250To me it smells like karmafarming. How is everyone buying this? Where's your reasonable doubt?