Sams Teach Yourself Game Programming in 24 Hours


Sams Teach Yourself Game Programming in 24 Hours demystifies game programming by providing clear, practical lessons using C/C++, the industry standard in game programming. The book focuses on the Windows API to construct games for the Windows platform and discusses game theory, including double-buffered graphics, sprite animation, and digitized sound effects and music. A fully functional game engine provides readers with the ability to create their own future games.

See more details below
Multimedia Set
$35.99 price
(Save 10%)$39.99 List Price

Pick Up In Store

Reserve and pick up in 60 minutes at your local store

Other sellers (Multimedia Set)
  • All (22) from $1.99   
  • New (7) from $2.72   
  • Used (15) from $1.99   
Sending request ...


Sams Teach Yourself Game Programming in 24 Hours demystifies game programming by providing clear, practical lessons using C/C++, the industry standard in game programming. The book focuses on the Windows API to construct games for the Windows platform and discusses game theory, including double-buffered graphics, sprite animation, and digitized sound effects and music. A fully functional game engine provides readers with the ability to create their own future games.

Read More Show Less

Editorial Reviews

From Barnes & Noble
The Barnes & Noble Review
Thousands of programmers share the same guilty fantasy: They'd rather be programming games. Hey, the U.S. video game hardware and software sales will be worth $10-$12 billion in 2003. There ought to be a place for you in an industry this big.

Of course, game programming is its own world: Writing game engines is a far cry from writing Windows-based B2B applications. One great way to get started is to read Sams Teach Yourself Game Programming in 24 Hours. Expert Windows programmer and author Michael Morrison presents a complete first course in Windows-based game programming, organized in 24 hands-on lessons.

You'll start with a high-level overview of the basics of game design, from concept and storyline to visualizing graphics, controlling game play, and exploring the tools of the trade. Even if someone else winds up making these decisions, Morrison's introductions clarify exactly how you'll fit into the process.

In "Hour 2," Morrison introduces Windows-specific aspects of game development, from basic event-driven programming to handling strange data types and unconventional coding conventions.

Next, he explains how game engines streamline the tasks that recur in most games (for example, initialization and cleanup). You'll walk through creating a simple game engine, learning how to separate game code from standard Windows code -- so you can hide the muss and fuss associated with Windows programs, and focus more energy on building great games.

Morrison next moves on to simple game graphics programming, introducing basic Windows graphics techniques and taking you "under the hood" with bitmap images and classes. In "Hours" 6 and 7, you take an in-depth look at input devices, learning how to control games with the keyboard and mouse, how to revamp your game engine to incorporate input from joysticks.

Along the way, you've been writing plenty of C/C++ sample code; now, Morrison shows how to integrate what you've learned into a complete -- albeit simple -- game. Then, it's on to animation.

In a "Crash Course in Game Animation," Morrison explains key concepts such as frame rate, compares 2D and 3D animation, and shows how animation can be applied in games. You'll learn how to use "sprites" in games, design an all-purpose sprite, integrate "sprite management" into your game engine, and then enhance the appearance of your sprite-based animation; for example, by eliminating flicker with double buffering.

At this point, you'll pause to write another complete game, drawing on the animation techniques you've just learned. Inspired by Frogger, Morrison's "Henway" requires chickens to cross the road without getting squashed. To build this game, you'll need to create and manage Start and Finish Areas, a Highway, as well as sprites for both chickens and cars. When your players' three chickens have all been run over, the game is finished (so you'll also need to help players keep track of how many chickens they've got left).

Next, you'll learn how to add audio tracks to your games -- and build "Battle Office," a game that chronicles an interoffice war between co-workers (neat idea, huh?) Then, it's on to animating your sprites and giving them backgrounds; building simple artificial intelligence into your games; adding splash screens and demo modes; even keeping track of high scores.

Look, we're not talking about graduate school–level algorithms, Lightwave 3D character animation, or DirectShow video rendering here. But if you want a solid basic foundation in Windows game development, you've come to the right place. Bill Camarda

Bill Camarda is a consultant, writer, and web/multimedia content developer. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.

Read More Show Less

Product Details

  • ISBN-13: 9780672324611
  • Publisher: Sams
  • Publication date: 12/24/2002
  • Series: Sams Teach Yourself Series
  • Pages: 488
  • Sales rank: 1,461,544
  • Product dimensions: 7.36 (w) x 9.14 (h) x 1.04 (d)

Meet the Author

Michael Morrison is a writer, developer, toy inventor, and author of a variety of computer technology books and interactive Web-based courses. In addition to his primary profession as a writer and freelance nerd for hire, Michael is the creative lead at Stalefish Labs, an entertainment company he co-founded with his wife, Masheed. The first commercial debut for Stalefish Labs is a traditional social/trivia game called Tall Tales: The Game of Myths, Legends, and Creative One-Upmanship ( When not glued to his computer, playing hockey, skateboarding, or watching movies with his wife, Michael enjoys hanging out by his koi pond. You can visit Michael on the Web at

Read More Show Less

Table of Contents

Introduction 1
Pt. I Getting Started 5
1 Learning the Basics of Game Creation 7
2 A Windows Game Programming Primer 25
3 Creating an Engine for Games 45
4 Learning to Draw Basic Graphics 69
5 Drawing Graphical Images 91
Pt. II Interacting with Game Players 111
6 Controlling Games with the Keyboard and Mouse 113
7 Improving Input with Joysticks 135
8 Example Game: Brainiac 155
Pt. III Animating Games with Sprites 171
9 A Crash Course in Game Animation 173
10 Making Things Move with Sprites 185
11 Managing a World of Sprites 205
12 Example Game: Henway 225
Pt. IV Making Noise with Sound and Music 243
13 Getting Acquainted with Digital Sound and Music 245
14 Playing Wave Sounds 257
15 Playing MIDI Music 271
16 Example Game: Battle Office 287
Pt. V Taking Animation to the Next Level 307
17 Animating the Appearance of Sprites 309
18 Creating Backgrounds for Your Sprites 323
19 Example Game: Meteor Defense 341
Pt. VI Adding Brains to Your Games 365
20 Teaching Games to Think 367
21 Example Game: Space Out 385
Pt. VII Spicing up Your Games 411
22 Adding Pizzazz to Your Game with a Splash Screen 413
23 Showing Off Your Game with Demo Mode 423
24 Keeping Track of High Scores 437
Pt. VIII Appendixes 455
A Quiz Answers 457
B Selecting a Game Development Tool 467
Index 471
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)