Game Programming All in One, by Jonathan Harbour. (This is NOT 3D Game Programming All in One, which is a Torque tutorial.) It uses C to program the Allegro game library (a multi-platform library). Even a VB.Net programmer will find the C language easily understandable in its listings. It comes with a CD that contains the Dev-C++ C compiler (much easier to use than Visual C++), the open-source Allegro game engine, the MappyAL game map designer, and a load of royalty-free sprites.
The book explores horizontal and vertical scrollers, animated sprites, collision detection and gravity effects, as well as sound functions. As far as learning C, a programmer of just about any language will find that a non-issue with this book. At most, you might need to refer to Sams Teach Yourself C++ in 10 Minutes, to clarify some of the funny C symbology, such as
myobject->length
Since Allegro is open source, its comprehensive documentation is somewhat disorganized (~120 pages with no TOC or index), and is mainly useful for looking up some particular syntax. The Harbour book, on the other hand, is well organized, and covers all of the essential aspects (except 3D) in a systematic way, with admirably clear demo code (most of which is presented in the context of a functional game). Allegro does 3D as well as 2D, but that is beyond the scope of the book. After reading the book, you would have to dig the 3D functions out of the Allegro documentation, or go on-line to the numerous Allegro user sites for tutorials. The book provides a number of URLs for these sites.
Now about Allegro. It supports the following operating systems (and more): Mac OS X, Windows, MS-DOS, IRIX, Linux, Darwin, FreeBSD, BeOS and QNX. It does 2D and 3D functions, and for Windows compilers generates specific calls to DirectX 8.
Some specifics:
Raster operations - lines, geometric shapes, Beziers, etc.
Filling
2D Sprites - masks, run-length encoding, compiled sprites, translucency, lighting
Bitmaps - blitting, rotation, scaling, clipping
3D Polygons - wireframe, flat-shaded, gouraud-shaded, texture-mapped, z-buffered
Scrolling - double or triple-buffered, hardware-scrolling
Animation - flip-book animated bitmaps, FLI/FLC playback
Windows Drivers - Direct X windowed and full-screen, GDI device contexts
DOS Drivers - Bunches of drivers for DOS as well as for all supported OSs
Sound:
Wavetable MIDI - volume, pitch, pan, blend, drum mappings
Digital Sound - 64 channels, forward, reverse, pitch, pan
Windows & DOS Drivers - WaveOut Direct Sound, Windows Sound System, AdLib, SB, SBPro, SB16, AWE32, MPU-401, ESS Audio drive, Ensoniq
Other Features:
Device Input - mouse, keyboard, joystick
Timers - Hi-res timers, interrupts, vertical-retrace
Compression - read/write LZSS compression files
Data Files - Multi-object data files, encryption, compression
Math Functions - Fixed Point arithmetic, trigonometric lookup tables
3D Functions - vector, matrix, quaternion manipulation
Text Output - Proportional fonts, UTF-8, UTF-16, Unicode
Oh! Did I mention that Allegro is free and royalty-free? It doesn't have a physics engine, but since gravity and momentum are easy computations, and collision can be easily handled with bounding spheres and boxes, I think Allegro is an amazing bargain. But I don't think I would have the patience to learn it from scratch by using just its own documentation.
The MappyAL map editor, which also comes with the book, allows you to import a set of tile bitmaps as a source pallet of tiles and draw them onto a map of just about any size, in up to 5 layers. Each drawn tile can hold up to 7 embedded data values, and can be toggled for collision. Among the many output options is a CSV list of the entire map containing the tile indexes. MappyAL is also free and royalty-free. When referenced into an Allegro-based C program, MappyAL is tightly integrated, automating many of its features.
FOR TEACHING A CLASS?
Since this is a Thomson/Course Technology book, college instructors may wonder if it is suitable for teaching a class on game programming. It certainly is. (Appropriate prerequisites would be either a semester of C or C++, or two semesters of VB.Net.) This would allow each student to build several complete games for his or her portfolio during the span of a single semester. Attempting to include meaningful 3D game development in this first semester course would up the ante of prerequisites to an unacceptable level. Make 3D a second semester of game development.
Also for would-be instructors, all the required software comes FREE with the book. One down-side for an instructor is that there is little course support accompanying this book. Yes, there are end-of-chapter questions, but they are not particularly exam material. There is no syllabus, no teaching notes, and no PowerPoint slides. As a teacher, I just say, "so what." Standard course support is probably meaningless for this particular subject area.
BIGGEST COMPLAINT:
Getting the Allegro libraries properly installed and compiled, so you can begin the book, is quite troublesome. Unfortunately, the comfortable narrative style of the main body of the text is continued in the two appendixes that explain the excruciating process of setting up Allegro. A numbered, step-by-step list would remove much of the present ambiguity in the instructions. Contributing to the confusion is the merging of steps among the several compilers explicitly supported: "It's exactly the same, except for these differences." Boo! Present separate, step-by-step lists in the next edition.
CONCLUSION: This is a great book for new game developers. The writing is lucid, and should be easily understandable to a programmer with moderate experience in just about any language. VB guys, have no fear. College instructors will have as much fun as their students. Since the Allegro game library also includes support for 3D game development, none of the material learned here will go to waste.