did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9781598632897

Game Programming All in One

by
  • ISBN13:

    9781598632897

  • ISBN10:

    1598632892

  • Edition: 3rd
  • Format: Paperback
  • Copyright: 2006-10-23
  • Publisher: Cengage Learning PTR
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $49.99

Summary

Game Programming All in One, Third Edition gives aspiring game programmers the skills that are needed to create professional-quality games. If you have a working knowledge of C or C++ and are ready to expand your skills into the field of game programming, then get ready to begin your journey with this latest edition! You won't cover the topic of programming in general, but rather the specifics of programming for games. Using the cross-platform Allegro game library, you'll learn how to write complete games that will run on almost any operating system. Both Windowsr and Linuxr screenshots are displayed throughout. Using the techniques taught within this book and the tools included on the CD-ROM, you'll be able to write standard Windows and DirectXr programs without the cost of an expensive compiler.

Table of Contents

Introduction xviii
PART I CROSS-PLATFORM GAME PROGRAMMING WITH THE ALLEGRO GAME LIBRARY
1(240)
Demystifying Game Development
3(40)
Introduction
4(3)
Practical Game Programming
5(2)
Goals Revisited
7(1)
The High-Level View of Game Development
7(3)
Recognizing Your Personal Motivations
10(12)
Decision Point: College versus Job
11(1)
Every Situation Is Unique
12(2)
A Note about Specialization
14(2)
Game Industry Speculation
16(1)
Emphasizing 2D
17(2)
Finding Your Niche
19(3)
Getting into the Spirit of Gaming
22(12)
Starship Battles: An Inspired Fan Game
22(8)
Axis & Allies: Hobby Wargaming
30(3)
Setting Realistic Expectations for Yourself
33(1)
An Introduction to Allegro
34(6)
DirectX Is Just Another Game Library
34(2)
Introducing the Allegro Game Library
36(4)
Summary
40(1)
Chapter Quiz
40(3)
Getting Started with the Allegro Game Library
43(50)
Allegro's Versatility Explained
44(1)
Configuring Your Favorite C++ Compiler
45(36)
Overview of the Compiler Configurations
46(1)
Windows Platform
46(29)
Linux Platform
75(4)
Mac Platform
79(2)
Taking Allegro for a Spin
81(9)
Introducing Some of Allegro's Features
81(1)
Running the GetInfo Program
82(1)
Adding to the GetInfo Program
82(8)
Summary
90(1)
Chapter Quiz
91(2)
2D Vector Graphics Programming
93(56)
Your Ideal Game?
94(2)
Introduction
96(3)
Graphics Fundamentals
99(8)
The InitGraphics Program
100(5)
The DrawBitmap Program
105(2)
Drawing Graphics Primitives
107(30)
Drawing Pixels
107(2)
Drawing Lines and Rectangles
109(11)
Drawing Circles and Ellipses
120(8)
Drawing Splines, Triangles, and Polygons
128(7)
Filling In Regions
135(2)
Printing Text on the Screen
137(4)
Constant Text Output
137(2)
Variable Text Output
139(1)
Testing Text Output
140(1)
Fun with Math and Vectors
141(5)
Summary
146(1)
Chapter Quiz
146(3)
Writing Your First Allegro Game
149(26)
Tank War
150(25)
Creating the Tanks
151(2)
Firing Weapons
153(2)
Tank Movement
155(1)
Collision Detection
156(1)
The Complete Tank War Source Code
157(15)
Summary
172(1)
Chapter Quiz
172(3)
Getting Input from the Player
175(46)
Handling Keyboard Input
176(11)
The Keyboard Handler
176(1)
Detecting Key Presses
177(2)
The Stargate Program
179(4)
Buffered Keyboard Input
183(1)
Simulating Key Presses
184(1)
The KeyTest Program
185(2)
Handling Mouse Input
187(17)
The Mouse Handler
187(1)
Reading the Mouse Position
187(1)
Detecting Mouse Buttons
188(1)
Showing and Hiding the Mouse Pointer
188(2)
The Strategic Defense Game
190(8)
Setting the Mouse Position
198(2)
Limiting Mouse Movement and Speed
200(1)
Relative Mouse Motion
200(1)
Using a Mouse Wheel
201(3)
Handling Joystick Input
204(13)
The Joystick Handler
204(1)
Detecting Controller Stick Movement
205(4)
Detecting Controller Buttons
209(1)
Testing the Joystick Routines
210(7)
Summary
217(1)
Chapter Quiz
218(3)
Mastering the Audible Realm
221(20)
The PlayWave Program
222(2)
Sound Initialization Routines
224(3)
Detecting the Digital Sound Driver
225(1)
Reserving Voices
225(1)
Setting an Individual Voice Volume
225(1)
Initializing the Sound Driver
226(1)
Removing the Sound Driver
226(1)
Changing the Volume
226(1)
Standard Sample Playback Routines
227(2)
Loading a Sample File
227(1)
Playing and Stopping a Sample
228(1)
Altering a Sample's Properties
228(1)
Creating and Destroying Samples
228(1)
Low-Level Sample Playback Routines
229(3)
Allocating and Releasing Voices
229(1)
Starting and Stopping Playback
229(1)
Status and Priority
230(1)
Controlling the Playback Position
230(1)
Altering the Playback Mode
230(1)
Volume Control
230(1)
Pitch Control
231(1)
Panning Control
231(1)
The SampleMixer Program
232(2)
Playing Music
234(4)
Midi Basics
235(1)
Loading a Midi File
235(1)
Getting the Midi Length
236(1)
Playing a Midi File
236(1)
Example Program
236(2)
Summary
238(1)
Chapter Quiz
238(3)
PART II SPRITE PROGRAMMING
241(190)
Basic Bitmap Handling and Blitting
243(26)
Introduction
244(1)
Dealing with Bitmaps
245(11)
Creating Bitmaps
247(2)
Cleaning House
249(1)
Bitmap Information
250(2)
Acquiring and Releasing Bitmaps
252(1)
Bitmap Clipping
253(1)
Loading Bitmaps from Disk
253(3)
Blitting Functions
256(3)
Standard Blitting
257(1)
Scaled Blitting
257(1)
Masked Blitting
258(1)
Masked Scaled Blitting
259(1)
Enhancing Tank War---From Vectors to Bitmaps
259(6)
Summary
265(1)
Chapter Quiz
265(4)
Introduction to Sprite Programming
269(46)
Basic Sprite Handling
270(23)
Drawing Regular Sprites
270(5)
Drawing Scaled Sprites
275(1)
Drawing Flipped Sprites
276(2)
Drawing Rotated Sprites
278(8)
Drawing Pivoted Sprites
286(4)
Drawing Translucent Sprites
290(3)
Enhancing Tank War
293(18)
What's New?
294(3)
Modifying the Source Code
297(14)
Summary
311(1)
Chapter Quiz
312(3)
Sprite Animation
315(50)
Animated Sprites
316(28)
Drawing an Animated Sprite
316(4)
Creating a Sprite Handler
320(8)
Grabbing Sprite Frames from an Image
328(7)
The Next Step: Multiple Animated Sprites
335(9)
Drawing Sprite Frames Directly
344(5)
The drawframe Function
344(1)
Testing the drawframe Function
345(4)
Enhancing Tank War
349(12)
Summary
361(1)
Chapter Quiz
361(4)
Advanced Sprite Programming
365(46)
Compressed Sprites
366(8)
Creating and Destroying Compressed Sprites
366(1)
Drawing Compressed Sprites
367(1)
The RLESprites Program
367(7)
Compiled Sprites
374(4)
Using Compiled Sprites
375(1)
Testing Compiled Sprites
376(2)
Collision Detection
378(10)
The CollisionTest Program
383(5)
Wrapping Up the Sprite Code
388(11)
Sprite Definition
389(1)
Sprite Implementation
390(3)
Sprite Handler Definition
393(1)
Sprite Handler Implementation
394(1)
Testing the Sprite Classes
395(4)
Angular Velocity
399(8)
Summary
407(1)
Chapter Quiz
407(4)
Programming the Perfect Game Loop
411(20)
Timers
411(11)
Installing and Removing the Timer
412(1)
Slowing Down the Program
412(1)
The TimerTest Program
413(9)
Interrupt Handlers
422(4)
Creating an Interrupt Handler
422(1)
Removing an Interrupt Handler
423(1)
The InterruptTest Program
423(3)
Using Timed Game Loops
426(2)
Slowing Down the Gameplay ... Not the Game
426(1)
The TimedLoop Program
426(2)
Summary
428(1)
Chapter Quiz
429(2)
PART III SCROLLING BACKGROUNDS
431(156)
Programming Tile-Based Scrolling Backgrounds
433(44)
Introduction to Scrolling
434(5)
A Limited View of the World
435(4)
Introduction to Tile-Based Backgrounds
439(11)
Backgrounds and Scenery
439(1)
Creating Backgrounds from Tiles
440(1)
Tile-Based Scrolling
441(4)
Creating a Tile Map
445(5)
Enhancing Tank War
450(24)
Exploring the All-New Tank War
451(2)
Why Are the New Features Not Present?
453(1)
The New Tank War Source Code
454(20)
Summary
474(1)
Chapter Quiz
474(3)
Creating a Game World: Editing Tiles and Levels
477(32)
Creating the Game World
477(9)
Installing Mappy
478(1)
Creating a New Map
478(3)
Importing the Source Tiles
481(2)
Saving the Map File as FMP
483(1)
Saving the Map File as Text
484(2)
Loading and Drawing Mappy Level Files
486(5)
Using a Text Array Map
487(4)
Enhancing Tank War
491(14)
Description of New Improvements
492(2)
Modifying the Tank War Project
494(11)
Future Changes to Tank War
505(1)
Summary
505(1)
Chapter Quiz
505(4)
Loading Native Mappy Files
509(18)
Studying the Mappy Allegro Library (MappyAL)
509(4)
The MappyAL Library
510(3)
Loading a Native Mappy File
513(2)
Enhancing Tank War
515(9)
Proposed Changes to Tank War
516(2)
Modifying Tank War
518(6)
Summary
524(1)
Chapter Quiz
525(2)
Vertical Scrolling Arcade Games
527(36)
Building a Vertical Scroller Engine
527(9)
Creating Levels Using Mappy
529(3)
Filling in the Tiles
532(1)
Let's Scroll It
533(3)
Writing a Vertical Scrolling Shooter
536(24)
Describing the Game
537(2)
The Game's Artwork
539(3)
Writing the Source Code
542(18)
Summary
560(1)
Chapter Quiz
560(3)
Horizontal Scrolling Platform Games
563(24)
Understanding Horizontal Scrolling Games
564(1)
Developing a Platform Scroller
565(1)
Creating Horizontal Platform Levels with Mappy
565(10)
Separating the Foreground Tiles
570(4)
Performing a Range Block Edit
574(1)
Developing a Scrolling Platform Game
575(9)
Describing the Game
576(1)
The Game Artwork
577(1)
Using the Platform Scroller
578(1)
Writing the Source Code
579(5)
Summary
584(1)
Chapter Quiz
585(2)
PART IV TAKING IT TO THE NEXT LEVEL
587(152)
The Importance of Game Design
589(44)
Game Design Basics
590(9)
Inspiration
590(1)
Game Feasibility
591(1)
Feature Glut
591(1)
Back Up Your Work
592(1)
Game Genres
593(6)
Game Development Phases
599(3)
Initial Design
599(1)
Game Engine
600(1)
Prototype
600(1)
Game Development
601(1)
Quality Control
601(1)
Beta Testing
602(1)
Post-Production
602(6)
Official Release
603(1)
Out the Door or Out the Window?
603(1)
Managing the Game
603(1)
A Note about Quality
604(1)
Empowering the Engine
605(1)
Quality versus Trends
605(1)
Innovation versus Inspiration
606(1)
The Infamous Game Patch
607(1)
Expanding the Game
607(1)
Future-Proof Design
608(1)
Game Libraries
608(1)
Game Engines and SDKs
609(1)
What Is Game Design?
609(1)
The Design Document
610(1)
The Importance of Good Game Design
611(1)
The Two Types of Designs
612(1)
Mini Design
612(1)
Complete Design
612(1)
A Sample Design Doc
613(2)
General Overview
613(1)
Target System and Requirements
613(1)
Story
614(1)
Theme: Graphics and Sound
614(1)
Menus
614(1)
Playing a Game
614(1)
Characters and NPCs Description
614(1)
Artificial Intelligence Overview
614(1)
Conclusion
614(1)
A Sample Game Design: TREK
615(2)
User Interface
616(1)
Main Display
617(12)
The Galaxy
618(3)
Ship Movement
621(2)
Alien Races
623(2)
Combat and Damage
625(1)
Ship-to-Ship Combat
626(1)
Ship Classes
627(2)
Ship Systems
629(1)
Game Design Mini-FAQ
629(1)
Summary
630(1)
Chapter Quiz
630(3)
Using Datafiles to Store Game Resources
633(26)
Understanding Allegro Datafiles
634(1)
Creating Allegro Datafiles
635(4)
Using Allegro Datafiles
639(2)
Loading a Datafile
639(1)
Unloading a Datafile
640(1)
Loading a Datafile Object
640(1)
Unloading a Datafile Object
640(1)
Finding a Datafile Object
640(1)
Testing Allegro Datafiles
641(1)
Enhancing Tank War
642(15)
Modifying the Game
643(13)
Final Comments about Tank War
656(1)
Summary
657(1)
Chapter Quiz
657(2)
Playing Movies and Cut Scenes
659(14)
Playing FLI Animation Files
659(4)
The FLI Callback Function
661(1)
The PlayFlick Program
661(2)
Playing an FLI from a Memory Block
663(1)
Loading FLIs into Memory
663(6)
Opening and Closing FLI Files
663(1)
Processing Each Frame of the Animation
664(1)
The LoadFlick Program
665(2)
The ResizeFlick Program
667(2)
Summary
669(1)
Chapter Quiz
669(4)
Introduction to Artificial Intelligence
673(24)
The Fields of Artificial Intelligence
674(8)
Expert Systems
674(2)
Fuzzy Logic
676(2)
Genetic Algorithms
678(2)
Neural Networks
680(2)
Deterministic Algorithms
682(5)
Random Motion
682(1)
Tracking
683(2)
Patterns
685(2)
Finite State Machines
687(2)
Revisiting Fuzzy Logic
689(4)
Fuzzy Logic Basics
689(3)
Fuzzy Matrices
692(1)
A Simple Method for Memory
693(1)
Artificial Intelligence and Games
693(1)
Summary
694(1)
Chapter Quiz
694(3)
Multi-Threading
697(22)
Multi-Threading
697(18)
Abstracting the Parallel Processing Problem
698(1)
The pthreads-Win32 Library
699(2)
Programming POSIX Threads
701(3)
The MultiThread Program
704(11)
Summary
715(1)
Chapter Quiz
715(4)
Publishing Your Game
719(20)
Is Your Game Worth Publishing?
719(2)
Whose Door to Knock On
721(1)
Learn to Knock Correctly
721(1)
No Publisher, So Now What?
722(1)
Contracts
722(2)
Non-Disclosure Agreement
722(1)
The Actual Publishing Contract
723(1)
Milestones
724(1)
Bug Report
724(1)
Release Day
724(1)
Interviews
724(9)
Paul Urbanus: Urbonix, Inc.
724(7)
Niels Bauer: Niels Bauer Software Design
731(2)
Summary
733(1)
References
733(1)
Chapter Quiz
733(2)
Epilogue
735(4)
Reviewing the Final Version of Tank War
736(1)
What's Next?
737(2)
PART V APPENDICES
739(38)
Appendix A Chapter Quiz Answers
741(20)
Appendix B ASCII Table
761(2)
Appendix C Numbering Systems: Binary, Decimal, and Hexadecimal
763(6)
Appendix D Recommended Books and Websites
769(8)
Index 777

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Rewards Program