I know 2 game engines that are free to use with limitations, which makes the easier to try out and get started.
-
Unity 3D - primarily uses C#
-
Unreal Engine - primarily uses C++
You might be looking for libraries that you can make smaller simpler games in, rather than full on triple-A game engines. In that case, using libraries to build games using web technologies (what your learning right now) is a good starting point.
-
Phaserjs - expansive, large community
-
Kaboomjs - simpler, great for learning
There are a number of “graphics” libraries for JS that can be used to create games using more lower-level control than the 2 above.
This really depends on what your goals are in the longer term. Learning to program in any language to anything complex would mean you know enough about general problem solving with code. You’d still have to learn a language’s syntax, but you wont have to re-learn how to use a programming language to solve something.
Game development requires a lot more than “just code”, there are a lot of levels beyond just the code you write. From the design, game play, visuals, music, controls, etc there is a lot to consider.
Because of this I’d think about what kind of games you’d want to learn to create, then pick a game engine/development environment that can handle it within the constraints you want. For example Unity 3D can make 2D side scrolling games, but would be vastly more overkill than using something like Phaserjs. Finally, once you have a game engine you have limited language choices and will more or less go off that.
Most game engine providers have some kind of store or gallery of games that are made, and often times you can download their assets and see how they where made.
This is where I’d be careful with your time. FreeCodeCamp will teach you JavaScript to be used within MERN stack web development. It doesn’t teach anything specifically about building games, or any other language except Python (the bottom half of the curriculum that focuses on data science)
The goal of FreeCodeCamp is to provide a framework and community to learn how to code so you can go out and do entry level web development, or at a bare minimum learn more about how the web works.
If your goal is to be an independent game developer you might not benefit as much as if you focused on a course/curriculum that is focused on game development.
Good luck, keep learning and keep building regardless of what you want to focus on!