So you want to be a game programmer?
By Alex Allain
First, the bad news: if you want to be a C++ game programmer, you’re going to have to learn how to program well. This means you’ll have to go from grand ambitious game design to low-level game programming details like how to draw a line across the screen. You’ll need to go from plot lines to reading lines from the files storing saved game data data. But the payoff is that if you do follow this advice, you will likely be capable of programming games that are enjoyable and cool. But first, the dose of medicine before the spoon full of sugar.
You’re not going to be able to cut corners learning to program. Find pointers confusing? That’s fine; they definitely can be. But you’re still going to need to learn how they work and understand them well because graphics APIs like OpenGL will require you to understand things like function pointers, and you’ll certainly need to use pointers throughout your program.
Moreover, you’ll almost certainly want to write some programs that aren’t game related (though you can certainly come up with lots of simple games to write while you learn–program a game of 15, hangman, or battleship to whet your appetite for things to come). Be prepared to stick it out and focus on the less sexy aspects of programming, like data structures such as linked lists or binary trees. These tools will become the building blocks of your future work, so learn them well!
You might be tempted to try to piece together high level ideas like “drawing sprites” and “playing music” by asking for snippets of code to do what you want. But the secret is that doing these things will be trivially easy compared to implementing the logic of the game–the stuff that makes it fun and interesting to play and that glues together these pieces.
As you learn, you’ll want to pay special attention to anything you can about designing programs. When you start to design your first real game, you’ll need to think both about plot and code, and the more ideas you’ve already picked up about how to design programs, the easier you will find it to plan out your game. In fact, as you start to write more interesting and difficult practice programs, you would probably benefit from taking the time to plan out the high-level structure of the program in advance. Design will be all the more important if you decide you want to work with a friend or as part of a team–without having a design up-front, integrating code written by several people can be extremely hard.
If you work hard at these things–learning your language of choice well and focusing on program design concepts–you will be well-positioned to write a good game and succeed in doing so. I’ve seen people go from no programming experience to writing fun graphics-intense games in about six months working at 10 to 20 hours per week. If you bear down and learn to program one step at a time, eventually you’ll reach the point where you can start writing the sort of programs that you really want to write. As a side benefit, you will have a good set of programming skills in case you decide that you’re more interested in other aspects of computer science than writing games!
Same Game – A Simple Game from Start to Finish A series of articles that teach you exactly how to create a game, starting at the very beginning and ending with a fully playable game
Getting started with programming Start on the road to learning how to program