Live data from Hacker News

Kaboom – JavaScript game programming library and environment

replit.com

61–70 of 74 posts

Re: Kaboom – JavaScript game programming library and environment

#61
post #35

Earlier quoted context omitted.

Yes, but it isn't the core way the language works -- you don't need to approach asynchronicity very early on as you do with JS, and it's not all closures. At some point someone learning Python will have to do something async. But what they can do up until then is just not do anything async, and that's fine (just wait for stuff to complete...). That's not really an option in JS: the great benefit of the language from…

In node, nearly all of the stuff has sync versions and global await is around the corner. For every other saner environment (read: browser consoles), global await is a thing already, and you get immediate feedback, and have a canvas (with sync APIs!). That being said, I do think that the best programming language to start learning is the one your parents/friends speak.

Great. I have no idea what "global await" means, but anyway, what's Node?

[shows them Node]

Oh, It's a calculator. Wow. I mean, wow. That's emm, really impressive.

[No, it's a runtime environment for JavaScript]

It's a what? So how does that help me move things around on the screen?

[It doesn't]

So explain what the point of Node is?

[etc]

Re: Kaboom – JavaScript game programming library and environment

#62
post #22

Earlier quoted context omitted.

Yes, but it isn't the core way the language works -- you don't need to approach asynchronicity very early on as you do with JS, and it's not all closures. At some point someone learning Python will have to do something async. But what they can do up until then is just not do anything async, and that's fine (just wait for stuff to complete...). That's not really an option in JS: the great benefit of the language from…

I’m sure you know about async/await in JavaScript? It sounds like the issue you have is not so much with the traditional paradigm of using callbacks, but the fact that the “default” environment in JavaScript is a GUI rather than a CLI, meaning that you need to figure out things like event handlers pretty early on?

Yes, default environment is the browser, that's a given and that's fine: if you are a beginner, making stuff happen there is easy and rewarding. Everyone has easy access to it

[I apologise for being a little snippy here]. I don't have an issue here: I don't think you & sibling commenters are really getting that these are beginners I'm talking about. Yes, I am aware of async/await. With the browser being the default environment, a beginner has to understand callback-related programming with JS quickly: they need to be able to say "I want to do this then this". You have do this via callbacks. You can write JS synchronously, but IME this isn't practical.

Using async/await isn't some magic bullet here. You can write synchronous-looking asynchronous code, but the level I'm talking about is: what does asynchronous mean? What does synchronous mean? Once they've got that (which is not simple), what's a Promise? That one's fun because you need to explain the concept and how they work first, and generally that's gibberish. Async/await helps, so say I ignore Promises and go straight to that. At which point the learner starts getting errors to do with unresolved values. And back to Promises we go. And so on.

I would say that I don't think there's any magic language that makes things easy for learners, and JS has many advantages over any other one, mainly to do with its general accessibility. But it's a fairly weird language in how it works, it isn't the simplest.

Re: Kaboom – JavaScript game programming library and environment

#63
post #38

Cool to see Kaboom on HN again! Kaboom is the culmination of multiple attempts at creating a game programming environment aimed at new coders. It started in 2018 when we noticed that many kids come to Replit from Scratch ready to transition from blocks to coding and get lost trying to find the best way to make games. There are many ways to make games with Replit -- pygame, html, love2d -- but based on our research th…

This is great! I remember working with my son when he was transitioning from Scratch to "code" about 4 years ago -- I wrote about my experience teaching him Javascript and the different analogies I used to explain functions, closures, arrays, etc. (https://medium.com/hackernoon/how-my-10-year-old-learned-jav...). Replit wasn't around back then, but he now uses it frequently with his school coding club. Great job!! If you need any help, feel free to reach out.

Re: Kaboom – JavaScript game programming library and environment

#64
post #22

Earlier quoted context omitted.

I’m sure you know about async/await in JavaScript? It sounds like the issue you have is not so much with the traditional paradigm of using callbacks, but the fact that the “default” environment in JavaScript is a GUI rather than a CLI, meaning that you need to figure out things like event handlers pretty early on?

Yes, default environment is the browser, that's a given and that's fine: if you are a beginner, making stuff happen there is easy and rewarding. Everyone has easy access to it [I apologise for being a little snippy here]. I don't have an issue here: I don't think you & sibling commenters are really getting that these are beginners I'm talking about. Yes, I am aware of async/await. With the browser being the default e…

I fully respect that these things are not easy for a complete beginner! I might not have expressed it very clearly but that’s what I tried to say; the browser environment requires you to deal with asynchronicity to do almost anything other than log to the console, so that makes it a tough place to start.

Re: Kaboom – JavaScript game programming library and environment

#65
This is such a wonderful initiative and could bring so many kids into programming! So many people start programming in order to make games and I could see this developing into the new standard for it & it being supported first class in replit makes it super simple to create and share your game.

I got a chance to try out kaboom last weekend and while it's already great for games, I'd love for it to also have more support for visualizations, something I used to spend a ton of time on in high school in khanacademy's processing.js editor[1]. Kaboom's support for ES6 and WebGL, focus on gaming, and integration with replit would make it a much better tool than KA for this. Some things in particular I'd like to see from kaboom for viz - it's missing basic raw functions like drawEllipse, the docs were difficult to read (I wish it would say what params something takes instead of "[conf]"), and in the end I failed to port over my voronoi viz[2][3]. If they decide this would be a good focus for them, I'd suggest having one of the built-in kaboom examples on replit to be a visualization.

[1] https://www.khanacademy.org/profile/raphaelrk/projects

[2] https://www.khanacademy.org/computer-programming/quick-voron...

[3] https://replit.com/@raphaelrk/CumbersomeAdmiredStrategies

Re: Kaboom – JavaScript game programming library and environment

#66
post #7

Earlier quoted context omitted.

Hm, but how does it work in python? Don't you have asynchronous calls there, too? (my main problem with JS as a programming first language is its C-Style syntax)

Yes, but it isn't the core way the language works -- you don't need to approach asynchronicity very early on as you do with JS, and it's not all closures. At some point someone learning Python will have to do something async. But what they can do up until then is just not do anything async, and that's fine (just wait for stuff to complete...). That's not really an option in JS: the great benefit of the language from…

Hey there, I've also taught lots of students online!

In my JS courses, I actually don't touch upon async things until I get to rather advanced/intermediate courses. Universally, I think the fundamentals of programming languages can be taught without too many drawbacks and agnostic of language choice unless the language is super verbose.

For example, all the things with closures, this, and asynchronous programming probably aren't relevant until a student runs into them/their gotchas while making web applications. By that point, I think framing it as event driven programming makes a lot of sense and gives context without being forced to deal with the details.

I think doing anything cool in other languages is also almost similar. A while loop/game loop in Python or other languages is pretty similar to the event loop which where the asynchronous nature of JS comes from. This becomes really apparent when working with games like Roblox/Lua and Minecraft/Minecraft plugins+mods.

Re: Kaboom – JavaScript game programming library and environment

#67
The addLevel() function seems especially interesting. It takes an array as input to generate the level, with each index being another row of the level. Here is the level from the linked platformer example.....

   "        $    ",
   "      ====   ",
   "             ",
   "     ^^      ",
   "=============",

Re: Kaboom – JavaScript game programming library and environment

#68
post #7

Earlier quoted context omitted.

Hm, but how does it work in python? Don't you have asynchronous calls there, too? (my main problem with JS as a programming first language is its C-Style syntax)

The secret of Javascript syntax is that, once you grok how functions are just special objects, it's actually a Lisp with a bunch of weird cruft attached to it.

And that is very helpful for a beginner to know ...

Re: Kaboom – JavaScript game programming library and environment

#69
post #9
post #4

I wish I had such tools when I was growing up building games! I had to battle ncurses, Allegro, OpenGL, and many more lower-level tech just to get some basic I/O. I'm not too sad about it because it paved the way to my stronger understanding of computer technologies, but at the same time it took me way longer to build playable games. I think this is a step before making Minecraft mods or Roblox games, but definitely…

Amos on the Amiga was pretty great. I was able to get sprites moving around, respond to mouse clicks, even some simple 3D with an extension. Admittedly never actually made a playable game, as my programming chops weren't good enough yet. There was a small community making games with it, and they would be distributed among other shareware.

As an adult at the time I made a game with AMOS (Mouse Impossible) and it was published free as a magazine cover disk. I was prouder of that than anything I did at work!

Re: Kaboom – JavaScript game programming library and environment

#70
post #35

Earlier quoted context omitted.

In node, nearly all of the stuff has sync versions and global await is around the corner. For every other saner environment (read: browser consoles), global await is a thing already, and you get immediate feedback, and have a canvas (with sync APIs!). That being said, I do think that the best programming language to start learning is the one your parents/friends speak.

Great. I have no idea what "global await" means, but anyway, what's Node? [shows them Node] Oh, It's a calculator. Wow. I mean, wow. That's emm, really impressive. [No, it's a runtime environment for JavaScript] It's a what? So how does that help me move things around on the screen? [It doesn't] So explain what the point of Node is? [etc]

Sorry, you need to be less cryptic for me to understand what you mean :)
Post reply on HN