Kaboom – JavaScript game programming library and environment
replit.com
replit.com
I think this is a step before making Minecraft mods or Roblox games, but definitely a welcome one for the coming generation of creative kids.
I had GW-BASIC. It took two lines to draw a line on the screen. There are not a lot of things as easy nowadays
https://docs.python.org/3/library/turtle.html
Isn't a terrible option for that sort of thing.
Wish that methodology was still around, you could do a lot with it.
When I evaluated different languages / environments to start teaching programming to my daughters I decided not to use Javascript because of that, chose Python instead (and now I'm also considering making games with Roblox, which is based on Lua. The dev environment is quite complex but with supervision Lua is a nice & simple programming language)
(my main problem with JS as a programming first language is its C-Style syntax)
Re. the syntax, anecdata but I've helped beginners through their initial steps for about 6 years now in JS (and Python) and C-type syntax is just not an issue that slows down learning or causes issues. There are only so many different ways syntax can be structured so it's sane for a compiler to parse, they all work basically the same way, and people get used to a syntax really quickly
[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.
And you need eventhandlers for games.
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.
[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]
A beginner at basic level, that's "what's a variable", "what's a function", "I don't see what the point of a function is". And something like Node -- it's just not a great environment to explain that: it doesn't do much that's interesting, like move stuff around on a screen. You can type stuff into the REPL, and it will spit things back, but that's just going to look like a calculator. Something like Processing, or a simple game engine aimed at beginners, or even making things happen on a web page using JS: that's good, it holds interest.
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.
(Apologies to other commenters as well! I got a little bit salty when people mentioned async in relation to beginner programmers because it's not a simple thing. It's abstract and doesn't really make a bunch of sense until the beginner has built a floor of very basic programming to stand on)
It's modeled a bit after the block-like paradigm introduced by Scratch, which I guess you can call "async" but seems really intuitive for kids.
We are at times our own worst enemy.
I want all libraries and frameworks to be presented this way
Would like to understand the differences if anyone explored already?
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
" $ ",
" ==== ",
" ",
" ^^ ",
"=============",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 there was still a big gap between the focused and intuitive experience at something like Scratch and anything that we offered at Replit. It felt like we were letting them down.
We thought in order to meet their needs we needed something that satisfied the following constraints:
1. required no setup, importing modules, or any other scaffolding before you start coding
2. had powerful primitives to make something interesting in a handful of lines of code
3. simple programming model
4. easy to import and use images and other assets
Our first attempt at this was a Python library called Play (https://github.com/replit/play). Play satisfied many of the constraints but because it was written in Python, and we execute Python on the server and stream graphics down to the client via VNC (https://blog.replit.com/native-graphics-love), the experience wasn't uniformly good for everyone using Replit. For example, for kids in India it was really bad (since then we started replicating our servers in India and other places in the world https://blog.replit.com/global).
Our second attempt was a classic BASIC implementation. BASIC was easy to get started with, it had zero bloat, and you could get something on the screen quickly. Sadly, users grew out of the language really quickly. BASIC made simple things straightforward but anything slightly more advanced was hard to impossible to make. I kept trying to evolve the language until it became kind of like QBASIC (optional line numbers, labels, etc). But it felt like sisyphean task.
BASIC HN discussion: https://news.ycombinator.com/item?id=23052050
BASIC docs: https://docs.replit.com/misc/basic
Last year, around the same time I gave up on "completing" BASIC I saw a job application come in for a designer from an indie game dev Tga. Tga was not only a great designer but also an awesome programmer, so we hired him. I pitched him on this project, we started prototyping it in Replit and got something working fairly quickly (early prototypes here: https://replit.com/@gameenv). When we rolled out an alpha version the most surprising thing that happened was that people on our team got addicted to making games. We weren't the target audience, but that's always a good sign. Then kids in our community started having a lot of fun with it -- the more we tested the more conviction we had that we had a solution to the problem.
The last few months we spent working on the Kaboom environment on Replit. It has an awesome asset editor, and a kick-ass debugging tools. And pretty soon we're going to have great autocomplete and intelisense.
To learn more check out the following:
- Kaboom blogpost: https://blog.replit.com/kaboom
- Show HN by designer: https://news.ycombinator.com/item?id=26728774
- Repo: https://github.com/replit/kaboom
Some games from the community:
- ReplJewled https://replit.com/@ConnorBrewster/ReplJeweled
- Flappy Mark https://replit.com/@slmjkdbtl/flappymark
- Bamboo Ninja https://replit.com/@RoBlockHead/KaboomJam
- Cookie Vs Oreo https://replit.com/@Coder100/COOKIE-VS-OREOS-KABOOMJS-BOOMOM...
But I can't believe you missed the opportunity to implement (Activision) Kaboom ;)
https://archive.org/details/a8b_Kaboom_1983_Activision_US_k_...
previous discussion: https://news.ycombinator.com/item?id=26728774