• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

learning game programming for C++

LumbergTech

Diamond Member
I am almost done with my computer science degree and haven't taken a C++ class. I have taken a variety of other languages and have a fairly good understanding of programming in general. I am almost done with the tutorial at http://www.cplusplus.com. My focus in school is/was database, but my true interest is games.
I am wondering what would be the best place to start to get into game programming.
 
Are you looking to get into game development professionally? If so you might want to focus on learning fundamental concepts of computer graphics and making your own simple game engine. If you want to just do it for a hobby try using an existing engine and work on more of the gameplay-specific code.
 
Personal projects is always the best place to start IMO.

Start with a simple game. Like, really simple, think zort. Next, move on to a console based game (where you have to write/rewrite the buffer). Then move on to a 2d game using some library like the sdl (or you could do it straight in opengl or directx if you like). And finally, finish up with something in 3d.

Game programming is tough and time consuming, so good luck. Get familiar with being able to read documentation. And for heavens sake, don't copy/paste code.

Good luck.
 
What about typing it in? I don't know how to start.
I found a tetris tutorial. I tried going over it and typing it in line by line and looking up a fair amount of what I saw.

I still don't have it fully functional, but it works somewhat.

I understand the structure of a Windows application a little better, and it familiarized me with with basic collision detection...

I still have a ways to go on comprehending the whole file.

Is this a worthwhile approach or is there another way that is more effective?
 
Is this a worthwhile approach or is there another way that is more effective?

The best approach is just reading and writing code, once you know the basics.

Teach-yourself-C++-in-21-days.png
 
What about typing it in? I don't know how to start.
I found a tetris tutorial. I tried going over it and typing it in line by line and looking up a fair amount of what I saw.

I still don't have it fully functional, but it works somewhat.

I understand the structure of a Windows application a little better, and it familiarized me with with basic collision detection...

I still have a ways to go on comprehending the whole file.

Is this a worthwhile approach or is there another way that is more effective?

reading someone else's code is ok for getting the gist of what is going on. However, just retyping it, using the copy function, ect is not ok. I can guarantee you that you won't learn anything until you take the principles from what they are solving and apply it to your problem.

For example
OK
I'm writing a pac-man clone. There is a tutorial for a tetris clone. thats how they start up the SDL, I should start it up similarly.

NOT OK
I'm writing a pac-man clone. There is a tutorial for a pac-man clone. I'll copy what they did and see what I'll learn from it.

Seriously, I've gone down the second path before in the exact same pursuit. I didn't learn a single thing from it. When things broke (IE I didn't write the exact same code) I was lost on how it was broken or how to fix it. Even after I finished it, I could not reproduce the results if I wanted to.

It wasn't until I took the "I'm going to do this my way" approach that the exact same tutorial (nehe if you are wondering) suddenly made a whole heck of a lot more sense. All the sudden I knew how to use glBegin() correctly. It is really quite a magical thing.

So don't get me wrong, I'm not trying to discourage you from reading others code. That can be really invaluable. What I'm trying to discourage is writing or copying others code. That is really counter productive. You'll end up with a big mass of code which you don't fully understand (not a good thing when you are supposed to be the one the writes it all).

It may be harder to do, but it is worth it for the learning aspect.
 
Back
Top