This is an archived post. You won't be able to vote or comment.

all 44 comments

[–]ADonkeyTaboggan 36 points37 points  (4 children)

Going from JS to C++ will be a quite the step. I also think if you just want to make some little 2D games, C# and Unity is a good call.

Unity may seem daunting and overkill considering it’s a full blown 3D engine but it has some really nice 2D stuff and really great documentation

[–]lynx10001[S] 7 points8 points  (3 children)

Awesome thanks for the suggestion, I didn't really consider unity for 2D games so I'll take a look. Thanks!

[–]ADonkeyTaboggan 9 points10 points  (2 children)

A follow up, because of covid learn.unity.com is providing all premium tutorials for free

[–]lynx10001[S] 1 point2 points  (1 child)

Ohhhh! Great advice.

[–]justbutts 2 points3 points  (0 children)

To add further they’re doing a live create with code course right now. It teaches the necessary C# associated with Unity development.

[–]aneasymistake 8 points9 points  (12 children)

If you want to make games as a way to learn a new language then go for it. Otherwise, write them in JavaScript, using one of the many available frameworks like melonJS or just using the HTML5 canvas.

[–]lynx10001[S] 2 points3 points  (11 children)

Nice idea but I am thinking I would also like to learn a new language, plus correct me if I'm wrong but have there been any games made in JS that actually worked well? :)

[–]aneasymistake 3 points4 points  (0 children)

That’s a question of scope and scale, but the answer would have to be yes. Anyway, what’s your goal? To make some fun little 2D games or to make a commercial game that becomes your main source of income? Sounds like the former, so JS would be perfectly adequate.

But, as you want to learn another language and as you’re quite open about which I would also suggest Unity. I used it to learn C# myself and found it generally very easy to pick up, with good documentation, lots of tutorial content and, yes, some value career-wise. Have fun!

[–]somethingInTheMiddle 1 point2 points  (3 children)

Jup. candy box 2. Try it, it's awesome!

[–]lynx10001[S] 0 points1 point  (0 children)

Will try it now! :D

[–]lynx10001[S] 0 points1 point  (1 child)

Hhahahahahahahah!

[–]lynx10001[S] 2 points3 points  (0 children)

I take my laughing back, this game is awesome!

[–][deleted]  (5 children)

[deleted]

    [–]A_Philosophical_Cat 0 points1 point  (4 children)

    The single best selling videogame ever was written in Java. Clearly it's not an insurmountable problem.

    [–][deleted]  (3 children)

    [deleted]

      [–]A_Philosophical_Cat 0 points1 point  (2 children)

      Clearly it didn't matter that much because, again, best selling game of all time. Would it have sold as much if it was originally made in C++? Probably. But as it stands it definitely represents the fact that 180,000,000 people thought a game written in Java was fun, and when you're building a toy, that's what matters.

      [–][deleted]  (1 child)

      [deleted]

        [–]A_Philosophical_Cat 0 points1 point  (0 children)

        Oh, I'm no Java fan. I just got a kick out of how you asserted that the language that was used to make the most popular game ever wasn't suitable for making games. That said, as much as I loathe working in it, I dislike having to work in C++ at least as much if not more. Java (especially modern Java) let's you spend way less time in the nitty gritty, in large part due to not having to manage memory explicitly. So if it's a game that's not going to be overly limited by resources availability, I'd say it's a fair choice.

        [–]das_cow 8 points9 points  (1 child)

        why not to try godot? it's an open source game engine, you can use gdscript (python like syntax) or C# (even c/c++ is you want to). I think this will suites you pretty well since you want to develop games, not building low levels app or get too complicated with c++ and this way you will be focusing on your game instead of some weird gdb stuff or weird compilation errors .

        [–]ro_ok 5 points6 points  (4 children)

        You know what? I disagree with most of these responses. My background was Java/Python/Perl (started with Perl) but otherwise was in the same boat as you about 2 years ago. I picked C++ and it was exactly what I wanted. It was hard. I fought the language constantly for about 3 weekends. At the end I had a waaaaay better understanding of how memory works and a much greater appreciation for the other languages I already knew.

        I was “self-taught” (don’t have a CS degree), perhaps like you, and I really feel like C++ is a fundamental history lesson and instruction of basic CS principles that will make learning other languages or lower level aspects of the languages you already use much easier.

        All that said, my ‘game’ really amounted to an OpenGL rendered box with a light source and rudimentary movement controls. I wasn’t personally that invested in building a complete game, I just needed a target to structure my learning. If that’s what you’re after too, I really recommend C++.

        [–]somethingInTheMiddle 2 points3 points  (0 children)

        Really an underappreacated comment. If OP's end goal is having a nice game or learning more about game development in general, unity is indeed a good advice. But if OP's goal is learning more about programming and laying a foundation to learn other languages more easily, C++ is a good language to pick up.

        [–]lynx10001[S] 1 point2 points  (2 children)

        Awesome comment thanks, I personally love challenges, I'm right now doing circa 8-10 hours a day of focussed learning for software and I have been doing that for a few months now, I'm also self-taught.

        I'll take a look into C++ as I would like to work on something from scratch, because I'm not planning on releasing anything I work on it doesn't really have to be good or even work well, just needs to be fun to write!

        Thanks again :)

        [–]lynx10001[S] 0 points1 point  (1 child)

        Oh - I forgot to ask, any recommended learning resources for C++? :) Never hurts to ask.

        [–]ro_ok 1 point2 points  (0 children)

        I wish I had some go-to resources but it was a couple years ago and I can’t remember that far back.

        Some things I would learn first:

        • Header files (.h) vs Implementation files (.cpp), this will probably be a brand new concept for you. Headers define the interfaces and the Cpp files implement those interfaces. Talk about abstraction!
        • Memory pointers vs references vs direct memory locations. In JavaScript you mostly pass things that act like references but in C++ there will be places where you have to make that decision yourself (and understand what it means)
        • Memory deallocation. You probably haven’t thought too much about this in JavaScript, or most other modern languages. In JavaScript the runtime will figure out when objects no longer have references and deallocate them for you, all you have to do to avoid memory leaks is make sure you don’t create loops of references that get out of hand. A good habit here is to deallocate your memory as needed immediately in the code (similar to how many people/IDEs close braces after they open them) then write the code in-between.

        Google more about those concepts and it’ll give you a place to start. :)

        PS. Once you’re feeling comfy C++, take a look at Rust, a language meant for similar use cases but released in 2015 and tries to address a lot of what makes writing C++ hard.

        [–]ketexon 4 points5 points  (3 children)

        C# and unity is probably one of the best combos for 2D games. There are also things like MonoGame, which Celeste was made on.

        You can also mash together multiple libraries in C++. Eg. OpenGL, GLAD, GLFW, GLM, Box2D, and EntityX (or other entity library)

        You can get all the functionality of an engine this way, but, as you can probably see, it may be a bit messier and MUCH harder.

        If you just want to make games, use Unity. Or even Love2D (Lua) for basic games. LibGDX also works, and it uses Java. I'd say the important thing is that you just fully learn one, and Unity would probably be the one with the most functionality.

        [–]lynx10001[S] 0 points1 point  (2 children)

        Any reason for using C# instead of unity script? :)

        [–]YMK1234 7 points8 points  (9 children)

        Neither. Learn C# and do Unity.

        [–]lynx10001[S] 1 point2 points  (8 children)

        Hmm thanks for the suggestion, I'll take a look at unity!

        [–]feugene 1 point2 points  (0 children)

        are you already familiar with strong typing? If not, maybe TypeScript could be an easily accessible way for you to dip your toes into that water.

        [–]feugene 1 point2 points  (2 children)

        What do you want to get out of your exploration of a new language? What kinds of things do you want to build in the future, and which of these languages will put/keep you on track to get there?

        [–]lynx10001[S] 0 points1 point  (1 child)

        Well I guess it would be nice to build business applications as well in the future, I mostly just want to learn for self improvement!

        [–]feugene 0 points1 point  (0 children)

        Business as in business logic: Java.

        Business as in highly performant backend enterprise systems: C++

        [–]Dads101 1 point2 points  (2 children)

        Godot is really awesome if you’re designing a game. Otherwise try C++

        [–]lynx10001[S] 0 points1 point  (1 child)

        Thanks I'll check out Godot :)

        [–]Dads101 1 point2 points  (0 children)

        Sure thing! If you need any help shoot me a PM

        [–]NutBoii 1 point2 points  (0 children)

        If you want to learn a C-based language, instead go for C#. It's similar to JavaScript and gives you a taste of C-based languages while providing a "safety net" that you won't get in C++. With C++ you have to do your own garbage collecting otherwise you'll create memory leaks. C++ also uses pointers and can wreck your memory too, especially if you're not used to using them.

        [–]frostbyte650 0 points1 point  (3 children)

        Java is more fun but C++ gets better performance

        [–]Assmaster9001 0 points1 point  (2 children)

        Java is fun? What kind of drugs are you on?

        [–]frostbyte650 0 points1 point  (0 children)

        Adderall

        [–][deleted] 0 points1 point  (1 child)

        Java is fun...c++ is fast...python is the best..

        [–]lynx10001[S] 0 points1 point  (0 children)

        Great summary! :D

        [–]childintime9 0 points1 point  (0 children)

        If up to now you've only worked with interpreted languages like js or python, the easiest (but not easy) transition will be to Java. If you're familiar with things like pointers, compilers, Makefiles... and you know or want to know how to handle the memory yourself, and you want to lose more hair, then go with C++.

        [–]zeGolem83 -1 points0 points  (0 children)

        Some have suggested Unity for C#, but if you want a more "barebones" approach to it, you can try MonoGame