Beginner Help

Started by
4 comments, last by Alberth 5 years, 5 months ago

I want to learn to code games in C++ but I have no idea where to start, can someone teach me?

Advertisement

I would suggest you start by learning C++ - if you haven't had any experience coding. If you have some coding experience, it would be a quick refresher to go through the basic topics, a few syntax differences etc. But then, it is learning and understanding important concepts of C++ like memory management, inheritance, polymorphism etc.

I would also suggest you take a look at Handmade Hero by Casey Muratori. Make sure, you see the "Intro to C" section too, where he walks you through debugging code using Visual Studio's debugger. Debugging code is a very important part in game development, which helps you understand how your code exactly works.

Hope that helps you.

Good luck!

2 hours ago, hmcdev said:

I want to learn to code games in C++ but I have no idea where to start, can someone teach me?

If you want to start with C++ I would suggest picking up C++ Primer (5th Edition): https://www.amazon.com/Primer-5th-Stanley-B-Lippman/dp/0321714113

You'll need Visual Studio: https://visualstudio.microsoft.com/vs/community/

There are a lot of tutorials and resources online but I would suggest starting with a good book first to get a good foundation. :)

Beyond that... just put in hours and do a lot of demo programs in console while learning! Then you can look into moving into 2D or 3D game development.

Best of luck.

Programmer and 3D Artist

My personal opinion is you learn best by doing.  However you need a good book to get you going.  I've know C++ for so long I can't really recommend something, because I haven't had to look into it for a while, but then you already have advice on that from  @Rutin

What I can tell you is that you should spend at least a bit of time programming in straight C. The reason I say this is that when you have to write in C with no standard library and stuff like that, you learn very quickly about general memory layout concepts. Even when you go to C++ this will be invaluable information. I've seen so many programmers that had a hard time debugging their own code because they didn't have basic knowledge of this stuff. So please do try to lean it.  This knowledge will help you over and over. You can write some C programs that just do text output. Like you can try to write tick, tack, toe or something of that nature that outputs to the console.  This will help you get your head around basic logic concepts. Technically you don't really need to be in C but at least avoid classes and the C++ standard library for the first few small projects (people always yell at me for this advice but I still think it's good. It may get me down voted though ?)

When you move to C++ you can start doing graphics. I use DirectX but it's a little hard core to start out with. I recently discovered SFML which I think is great! I had something running in a few minutes.  So that might be a good option for you when you get to that stage.

Another thing I'll say is DON"T LEARN A LANGUAGE. Learn to code. That doesn't actually mean what it sounds like. What it means is C++ is a big language and there is absolutely no reason to know ever bit of it, just to know it.  You will lean things as you need them over time. The MOST important thing is to learn about data structures and algorithms.  You can use those things in any language.  There are some snots out there that know every detail of C++ and they like to let you know it. But it doesn't mean squat really.  Probably a lot of those people can't program their way out of a paper bag. So don't get discouraged if you run into one. At the end of the day, it's what you can produce that matters not how much you know.

Finally the most important thing is motivation and the best way to get that is to see results.  Start out small and get something working. Then add too it and get that working and so forth. It's very hard to keep your motivation up when you are looking at lines of code for months and nothing is running. I know because I've done that . Anyway good luck, and welcome to the dark side! :D

As to understanding what "small" means, you may want to start by trying a few games from the list of this article

 

This topic is closed to new replies.

Advertisement