Advertisement

Is learning JavaScript a right way of beginning 2D-game programming?

Started by August 07, 2018 08:01 AM
14 comments, last by mr_tawan 6 years, 6 months ago

Classically, people would recommend beginning game programming with C++ and DirectX, but due to their complicatedness, it's not so easy to create even a 2D-game with these two tools, let alone 3D-games. So quite often, we'll see people use a lot of 3rd party libraries imported to Visual Studio, and these libraries are quite happy to create a lot of warnings when compiled, which isn't so beautiful.

A few months ago, while playing a mini-game of WeChat's "mini program", I found it simple enough, yet quite amazing! And later I learned it was created by JavaScript. Now I want to learn this new language, but I wonder if it is a right approach to creating 2D-, even 3D-games. By "right", I don't mean I want it to create complex games, but just to help me learn and understand the basics of creating a mini game.

The worst result of having dreams is awaking.

Learning to make SMALL games in ANY language IS the right way. Go ahead! Make a 2D small game in JS/HTML5 for example. You'll learn a lot.

I do C++ on consoles... but I also made a tiny JS game back in the day just to try JS out: http://pcmaster.koinbahd.com/game0. I've also tried (and made similarly small and unfinished games) in Unity3D, C#, Java, Python, Delphi, OpenGL and many more longer ago. There's never enough :)

 

Advertisement
3 minutes ago, HarrySpiderman said:

Classically, people would recommend beginning game programming with C++ and DirectX

This is completely the opposite route anyone should be taking when starting out considering the other options on the table. Even when I started out almost two decades ago, I still used BASIC for a bit before jumping into C++.

4 minutes ago, HarrySpiderman said:

we'll see people use a lot of 3rd party libraries imported to Visual Studio, and these libraries are quite happy to create a lot of warnings when compiled, which isn't so beautiful.

I use 3rd party libraries all the time with C++ and I get zero problems. There is a big difference between a problem with said library and 'user' inflicted issues. I see countless linker errors, wrong headers, wrong directories set, ect... which are all caused by the user.

6 minutes ago, HarrySpiderman said:

A few months ago, while playing a mini-game of WeChat's "mini program", I found it simple enough, yet quite amazing! And later I learned it was created by JavaScript. Now I want to learn this new language, but I wonder if it is a right approach to creating 2D-, even 3D-games. By "right", I don't mean I want it to create complex games, but just to help me learn and understand the basics of creating a mini game.

Game programming concepts are universal, so starting out with a high level language is usually recommended as you can always learn lower level stuff like C++ later down the line. Languages are simply tools that we use to generate a desired result, so if using JavaScript, or C#, or any other language is easy for you, then that's the one you should pick. It's more important to pick the tool that will not discourage you from moving forward, which is why most people should avoid C++ and DirectX if they have zero programming experience.

Programmer and 3D Artist

31 minutes ago, Rutin said:

I use 3rd party libraries all the time with C++ and I get zero problems. There is a big difference between a problem with said library and 'user' inflicted issues. I see countless linker errors, wrong headers, wrong directories set, ect... which are all caused by the user. 

Thank you for your share and advices! As to the 3rd-party libs' problems, it's mainly due to the incompatibility between Visual Studio and these libs. Of course, most of these problems are presented as warnings, and you can eliminate them by lowering your warning levels, but I don't think that's a perfect idea.

The worst result of having dreams is awaking.

27 minutes ago, HarrySpiderman said:

Thank you for your share and advices! As to the 3rd-party libs' problems, it's mainly due to the incompatibility between Visual Studio and these libs. Of course, most of these problems are presented as warnings, and you can eliminate them by lowering your warning levels, but I don't think that's a perfect idea.

No problem. I personally rarely have issues with warnings. I either use the library that is designated for my IDE and version, or I build it myself.

Programmer and 3D Artist

23 minutes ago, Rutin said:

No problem. I personally rarely have issues with warnings. I either use the library that is designated for my IDE and version, or I build it myself.

Well, That sounds really cool, but for beginners like me, that's far too difficult, I'm afraid.

The worst result of having dreams is awaking.

Advertisement

Personally I would not use JavaScript to learn game programming. I use JavaScript a lot in my day job (Web Developer) and although it has some good points as a scripting language for controlling web pages, I do not like it as a language. There are many other better languages to use for a first project. C# is excellent, Python is great and even Lua is better than JavaScript. Unity uses C# and makes it reasonably simple to get things up and running quickly. There are loads of tutorials on Python games out there and there is the PyGame framework to get you going quickly. The other good tool is Pico-8. It is a fantasy console (basically an emulator) that restricts it to 8-bit (think the old NES and Master System consoles). It costs $15 but for that you get the entire development kit with audio creator and graphics creator etc. It is programmed in Lua and some great games originated on it including the amazing Celeste!

However I agree with @Rutin above in that it is best to use whatever you are most comfortable with. 

 

Also I have no idea who told you C++ and Direct X were the best way to learn game programming... That could not be further from the truth!

I'm not sure OP tried to start another programming language flame ;) I insist that trying to make a small game in ANY language is good for everyone. Nothing prevents anyone from trying 2 or more (environments) and eventually decide which one is good for their further little experiments.

1 hour ago, HarrySpiderman said:

Well, That sounds really cool, but for beginners like me, that's far too difficult, I'm afraid.

You might want to try VPCKG. I'm not saying that you won't run into problems. However, from my (little) time trying this out, it does simplify many thing regardings library setup and stuffs.

http://9tawan.net/en/

My first game is in Java, with Swing GUI and stuffs. My second is also in Java, but this time it's Java2D rendering (with OutOfMemoryException heres and theres). The reason that I only uses Java back then because .... it's the only language I'm good at at the time.

I eventually move to C# and C++ later as time goes on, that's what the job called for.

http://9tawan.net/en/

This topic is closed to new replies.

Advertisement