Game Programming All in One / Edition 2

Game Programming All in One / Edition 2

by Jonathan S. Harbour
     
 

ISBN-10: 1592003834

ISBN-13: 9781592003839

Pub. Date: 06/17/2004

Publisher: Cengage Learning

Get ready to create your own high-caliber games with some of the same tools used by professional game developers! If you have a working knowledge of C or C++, then Game Programming All in One, 2nd Edition is the ideal book to get you started on your journey. This practical programming book uses hands-on projects to explain each new subject and includes many sample

Overview

Get ready to create your own high-caliber games with some of the same tools used by professional game developers! If you have a working knowledge of C or C++, then Game Programming All in One, 2nd Edition is the ideal book to get you started on your journey. This practical programming book uses hands-on projects to explain each new subject and includes many sample programs to reinforce the material in each chapter. You'll begin by learning about cross-platform game programming, writing code that will run under Windows, Linux, Mac OS X, and many other systems. Enhance your skills by working through the core features of the Allegro game library and writing code to load images, manipulate sprites, scroll the background, use double-buffering, read a joystick, detect collisions, and implement other core features of any game. You will gain experience by creating a complete game and adding features to it in each new chapter. You will also learn how to write a scrolling platform game and a vertical shooter.

Product Details

ISBN-13:
9781592003839
Publisher:
Cengage Learning
Publication date:
06/17/2004
Edition description:
Older Edition
Pages:
752
Product dimensions:
7.36(w) x 8.88(h) x 1.84(d)

Related Subjects

Table of Contents

Introductionxxv
Part IIntroduction to Cross-Platform Game Programming1
Chapter 1Demystifying Game Development3
Introduction4
The High-Level View of Game Development6
Recognizing Your Personal Motivations9
Getting into the Spirit of Gaming18
An Introduction to Dev-C++ and Allegro25
Summary30
Chapter Quiz31
Chapter 2Getting Started with Dev-C++ and Allegro33
Introduction34
Installing and Configuring Dev-C++ and Allegro35
Taking Dev-C++ and Allegro for a Spin43
Gaining More Experience with Allegro63
Summary68
Chapter Quiz68
Chapter 3Basic 2D Graphics Programming with Allegro71
Introduction72
Graphics Fundamentals74
Drawing Graphics Primitives82
Printing Text on the Screen112
Summary115
Chapter Quiz116
Chapter 4Writing Your First Allegro Game119
Tank War119
Summary141
Chapter Quiz142
Chapter 5Programming the Keyboard, Mouse, and Joystick145
Handling Keyboard Input146
Handling Mouse Input155
Handling Joystick Input170
Summary182
Chapter Quiz182
Part II2D Game Theory, Design, and Programming185
Chapter 6Introduction to Game Design187
Game Design Basics188
Game Development Phases195
Post-Production198
Future-Proof Design203
What Is Game Design?204
The Dreaded Design Document205
The Importance of Good Game Design206
The Two Types of Designs206
A Sample Design Document Template207
A Sample Game Design: Space Invaders209
Game Design Mini-FAQ212
Summary212
Chapter Quiz212
Chapter 7Basic Bitmap Handling and Blitting215
Introduction215
Dealing with Bitmaps217
Blitting Functions227
Enhancing Tank War--From Graphics Primitives to Bitmaps229
Summary234
Chapter Quiz234
Chapter 8Basic Sprite Programming: Drawing Scaled, Flipped, Rotated, Pivoted, and Translucent Sprites237
Basic Sprite Handling238
Enhancing Tank War259
Summary276
Chapter Quiz276
Chapter 9Advanced Sprite Programming: Animation, Compiled Sprites, and Collision Detection279
Animated Sprites280
Run-Length Encoded Sprites306
Compiled Sprites313
Collision Detection317
The Collision Test Program319
Enhancing Tank War324
Summary336
Chapter Quiz337
Chapter 10Programming Tile-Based Backgrounds with Scrolling339
Introduction to Scrolling340
A Limited View of the World341
Introduction to Tile-Based Backgrounds345
Enhancing Tank War355
Summary378
Chapter Quiz378
Chapter 11Timers, Interrupt Handlers, and Multi-Threading381
Timers381
Interrupt Handlers392
Using Timed Game Loops395
Multi-Threading397
Enhancing Tank War413
Summary426
Chapter Quiz426
Chapter 12Creating a Game World: Editing Tiles and Levels429
Creating the Game World429
Loading and Drawing Mappy Level Files436
Enhancing Tank War445
Summary453
Chapter Quiz453
Chapter 13Vertical Scrolling Arcade Games455
Building a Vertical Scroller Engine455
Writing a Vertical Scrolling Shooter464
Summary487
Chapter Quiz487
Chapter 14Horizontal Scrolling Platform Games489
Understanding Horizontal Scrolling Games490
Developing a Platform Scroller490
Creating Horizontal Platform Levels with Mappy491
Developing a Scrolling Platform Game498
Summary506
Chapter Quiz507
Part IIITaking It to the Next Level509
Chapter 15Mastering the Audible Realm: Allegro's Sound Support511
The PlayWave Program512
Sound Initialization Routines514
Standard Sample Playback Routines517
Low-Level Sample Playback Routines518
The SampleMixer Program522
Enhancing Tank War525
Summary537
Chapter Quiz537
Chapter 16Using Datafiles to Store Game Resources539
Understanding Allegro Datafiles540
Creating Allegro Datafiles541
Using Allegro Datafiles544
Testing Allegro Datafiles545
Summary547
Chapter Quiz548
Chapter 17Playing FLIC Movies551
Playing FLI Animation Files551
Loading FLIs into Memory554
Summary561
Chapter Quiz561
Chapter 18Introduction to Artificial Intelligence563
The Fields of Artificial Intelligence564
Deterministic Algorithms570
Finite State Machines575
Fuzzy Logic577
A Simple Method for Memory580
Artificial Intelligence and Games581
Summary581
Chapter Quiz582
Chapter 19The Mathematical Side of Games585
Trigonometry586
Vectors590
Matrices598
Probability603
Functions605
Summary608
Chapter Quiz608
Chapter 20Publishing Your Game611
Is Your Game Worth Publishing?611
Whose Door to Knock On612
Contracts614
Milestones615
Interviews616
Summary625
References626
Chapter Quiz626
Epilogue629
Part IVAppendixes631
Appendix AChapter Quiz Answers633
Chapter 1633
Chapter 2634
Chapter 3635
Chapter 4635
Chapter 5636
Chapter 6637
Chapter 7638
Chapter 8639
Chapter 9639
Chapter 10640
Chapter 11641
Chapter 12642
Chapter 13643
Chapter 14643
Chapter 15644
Chapter 16645
Chapter 17646
Chapter 18647
Chapter 19648
Chapter 20648
Appendix BUseful Tables651
Integral Equations Table651
Derivative Equations Table652
Inertia Equations Table652
ASCII Table653
Appendix CNumbering Systems: Binary and Hexadecimal657
Binary657
Decimal659
Hexadecimal659
Appendix DRecommended Books and Web Sites663
All in One Support on the Web663
Game Development Web Sites663
Publishing, Game Reviews, and Download Sites664
Engines664
Independent Game Developers664
Industry665
Computer Humor665
Recommended Books665
Appendix EConfiguring Allegro for Microsoft Visual C++ and Other Compilers671
Microsoft Visual C++672
Dev-C++673
KDevelop for Linux679
Final Comments683
Appendix FCompiling the Allegro Source Code685
Microsoft Visual C++685
Borland C++/C++Builder687
Dev-C++688
KDevelop for Linux689
Appendix GUsing the CD-ROM691
Index693

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >