Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a degree in Computer Science and while I was in college, I created a simple 2D game in Game Maker. I would like to recreate this game in C++ as a start to learning how to create games in C++. What would be a good book to start out on programming games in C++ for someone who has a bit of C++ experience (My CS Major classes were taught using Java and I had a class in C++ to learn syntax) and knowing the concepts behind objects, methods, inheritance, etc?

This would be a hobby of mine while I build up experience until I one day could work in the Vide Game Industry.

share|improve this question
    
If you need motivation (and you've got time) you may want to participate in pyweek or one of the pygame contests –  bobobobo Nov 3 '12 at 15:00
add comment

7 Answers

up vote 6 down vote accepted

Seeing as you were using Game maker, I'm assuming you're on Windows, so jump in at the deep end with the direct-x SDK. The samples provide source code, and also give you a taste of the power available to you. Just because you want to do a 2D game doesn't mean you should stick with a 2D library, at some point you'll probably want to do something the library doesn't implement in itself (shaders or rotations or something random that you just NEED for your project).

SDL -and probably SFML and Cinder- provides a high level "got the basics out of the way" approach to being an engine, so you would have all the power of doing it from scratch (so you could have pixel shaders in SDL), but you'd not learn how things got done. You'd then be doing real C++ inside a helper framework, which will help get stuff done, but won't be a great help in teaching you how to develop games if you're ever going to be working at a game dev company.

SDL, SFML, and even Cinder are all clever ways of avoiding learning about the difficult stuff in C++. They normally wrap OpenGL, which is useful to learn if you want to code graphics for non-windows machines, but there's tonnes of resources for getting work done in Direct-X too (probably more as the Windows virus has spread to every corner of the world).

If you don't want to learn the gritty stuff, then fine, but otherwise, don't be afraid to start from a raw Win32 app.

I'd suggest, for comfort, you start out with all the different helper packages you can find, but head towards writing your own rendering engine. Writing an engine is good fun and can provide you with a resource to look back on in your future projects. Nothing creates good code like the wisdom from doing it wrong in the past.

share|improve this answer
    
Thanks for the answer, I have experience in C++ and would like to get into the gritty stuff so I'd have experience in it. I would love for this hobby to eventually lead to a career in the Video Game Industry once I get some work experience. –  sange Sep 7 '10 at 17:39
add comment

Why not try starting out with something like http://libcinder.org/ - it's all free and has all the tutorials you need to get started.

share|improve this answer
add comment

I would recommend staying away from that Cinder library. Browsing through the tutorials is about as demotivational as it can get. Pick something that's easy, fun and fast to code with, like SFML. Think of it as a modern object-oriented replacement for SDL. If the features satisfy your needs, install it, go through the tutorials and just start playing with it. You can find source codes for existing SFML projects from the forums to look at how they implement things, such as the game loop, how they organize the code and the objects and make them communicate with one another and the Wiki has a number of tutorials and source codes you can use in your projects. And the forums are active so you can ask for help there anytime.

share|improve this answer
    
I'd never heard of that - looks way more appropriate than cinder for games! nice. –  Iain Sep 8 '10 at 8:34
add comment

I don't know any book specitic to 2D games, but you should look at the answers here. After all, 2D and 3D games have a lot in common. There are many 3D games that have 2D gameplay.

Maybe you could check the tutorials by Lazy Foo, they cover many important subjects in a step by step basis. They use SDL and OpenGL.

share|improve this answer
add comment

Beyond a book, it's important to decide what sort of game you want to make. That will help inform your path in general. I would suggest picking something simple, Minesweeper or Tetris or maybe Lightcycles of Tron, where the game logic is fairly straight forward and the graphics requirements are minimal just to get something basic playing.

share|improve this answer
add comment

Might be a little dated but Advanced 2D Game Development was a pretty good book. Check it out.

share|improve this answer
    
I just bought this book (waiting for it to arrive!) - in what terms would you say it's dated? –  Zolomon May 12 '11 at 7:14
    
Well since it came out in 2008, the tech certainly has changed. But the methods most likely are the same. Sorry it's been a while since I read it and nothing is coming to mind. –  radioact1ve Jun 9 '11 at 3:55
add comment

While there are plenty of books out there, I've not found one that I'm happy with. Most seem to stick to "games" that aren't particularly interesting from a play perspective, and don't really get into the implementation details of graphics, game loops, and so on.

My recommendation would be, rather than looking for a book, teach yourself through Google searching. There are tons of online tutorials for making simple games, just pick a game like Tetris (or whatever), make yourself a list of programming tasks, and then when you get stuck on something (maybe you're not sure how to accept realtime input, or how to draw graphics to the screen) search for the answer to that one specific question. Repeat every time you get stuck, and by the time you're done you'll have a pretty good idea of how a game is put together.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.