I'm a software developer working mostly on web applications. When I was younger, I wanted to make games but I shelved the dream pretty early because I had other interests and didn't know how to program anyway.<p>Couple of years later, I decided to pursue a BS in CS because I was interested in getting into AI, however during my degree, I realized that I enjoyed building applications/web apps better than fine-tuning ML models. So I shifted my interest and effort towards web development and got a normal SWE job after college. Also, I heard about the bad pay and working conditions in the games industry so I was never interested in joining it anyway.<p>During that time, I didn't think too much of video games as I basically stopped playing them for a while and was not willing to learn Unity/Unreal/Godot as they were specifc to the game industry. I preferred to build side projects in languages that I could put on my CV and would be relevant to web dev.<p>However, I soon realized that I could make games using the same programming language I was using for my job (JavaScript/TypeScript) so I gave it a try. This is how I was introduced to the world of JS game dev.<p>This is what I learned.<p>-> Making 2D games in JS is viable, graphics have come a long way in the browser.<p>-> There are many options you can use. Just like the plethora of frontend libraries/frameworks the same can be found in JS gamedev.<p>-> Monetizing games made in JS is also possible. You just have to wrap your games as a desktop app. Here again many options exists.<p>-> Games made in JS are easily shareable, which is ideal for game jams. You can then take your JS game jam game and continue developing it as a full release you can wrap as a desktop app and sale on Steam. I think this is the greatest advantage of making games with JS.<p>Here are the various options I came across so you can narrow down your choices when choosing how you'll make your game :<p>Lower level (No libraries being used):<p><pre><code> -> Canvas API (Easy enough)
-> WebGL API (Harder than the canvas but more performant)
-> WebGPU API (Early days, not widely supported)
</code></pre>
Medium level (Separate libraries for rendering and physics):<p><pre><code> -> Rendering: Pixi.js + Physics: Matter.js or Planck.js
-> Rendering: P5.js + Physics: Matter.js or Planck.js
-> Rendering: Kontra.js + Physics: (same options, there are probably more I'm unaware of)
... other options I'm unaware of.
</code></pre>
High level (Single libraries that takes care of both rendering, physics and even sound for some of them)<p><pre><code> -> Phaser3 (Most famous, Vampire Survivor is made with it)
-> Kaboom.js (The one I'm currently using, documentation is great and very easy to understand)
-> Excalibur.js (Very promising but below ver1. Latest version at the time of writing this is ver. 0.28)
-> Melon.js (Old but being currently revamped)
... other options I'm unaware of.
</code></pre>
Higher level (Full game engines)<p><pre><code> -> Ct.js
-> Cocos2d
-> Play Canvas
-> GDevelop (No code but can use javascript)
... other options I'm unaware of.
</code></pre>
I recommend the libraries in the high level section as I think those are the ones that gives you the most freedom to structure your codebase to your liking while giving you enough stuff out of the box to make your games quicker.<p>Anyway if you have yet to delve into the topic and you're interested, I made a YouTube channel teaching gamedev in JS through tutorials. Tutorials I already made include :<p><pre><code> -> How to make a Pokemon-like.
-> How to make a platformer.
-> How to make a fighting game.
</code></pre>
You can find my channel at https://youtube.com/@jslegenddev.
As a bonus, here are the options I explored when evaluating technologies to wrap my JS games as desktop apps.<p><pre><code> Electron : Known as being bloated, but allows you to make sure that your game is rendered the same on all platforms. It achieves this by shipping a whole chromium browser with a specific version where you game is ran. It's established and there are plenty of resources on how to use it. Another advantage is that you can use the Steam API if you ever wanted to put your games on Steam. This is done through the node Steam API bindings.
NW.js : Same thing as Electron. Less secure by default, you need to go out of your way to implement best security practices. Easier to use than Electron. It's basically drag and drop.
Tauri : Very promising and mobile support coming soon. Unfortunately you can't use the Steam API through the node Steam API bindings. Uses Rust so maybe you can interface with the Steam API through it. It has a JS API which allows you to write your app without needing to write Rust code. Uses the default webview of the OS so is less bloated. Cannot 100% guarantee that the game will be rendered the same on all platforms because unlike Electron it doesn't ship a whole chromium browser.
Neutralinojs : Same principles as Tauri but less popular and more limited.</code></pre>