You are previewing C# Game Programming: For Serious Game Creation.

C# Game Programming: For Serious Game Creation

Cover of C# Game Programming: For Serious Game Creation by Daniel Schuller Published by Course Technology PTR
  1. Copyright
    1. Dedication
  2. Acknowledgments
  3. About the Author
  4. Introduction
    1. CD-ROM Downloads
  5. I. Background
    1. 1. The History of C#
      1. C# Basics
      2. Summary
    2. 2. Introducing OpenGL
      1. Architecture of OpenGL
      2. OpenGL Is Changing
      3. OpenGL and the Graphics Card
      4. The Tao Framework
      5. Summary
    3. 3. Modern Methods
      1. Pragmatic Programming
      2. Summary
  6. II. Implementation
    1. 4. Setup
      1. Introducing Visual Studio Express—A Free IDE for C#
      2. Subversion, an Easy Source Control Solution
      3. Tao
      4. NUnit
      5. Summary
    2. 5. The Game Loop and Graphics
      1. How Do Games Work?
      2. Implementing a Fast Game Loop in C#
      3. Graphics
      4. Summary
    3. 6. Game Structure
      1. The Basic Pattern of a Game Object
      2. Handling Game State
      3. Game State Demo
      4. Setting the Scene with Projections
      5. Sprites
    4. 7. Rendering Text
      1. Font Textures
      2. Font Data
      3. Rendering Text
      4. Refining the Text Class
      5. Faster Rendering with glDrawArrays
      6. Summary
    5. 8. Game Math
      1. Trigonometric Functions
      2. Vectors
      3. Two-Dimensional Intersection
      4. Tweens
      5. Matrices
    6. 9. Making the Game Engine
      1. A New Game Engine Project
      2. Extending the Game Engine
      3. Adding Sound Support
      4. Improving Input
    7. 10. A Simple Side-Scrolling Shooting Game
      1. A Simple Game
      2. The First Implementation Pass
      3. Developing the Inner Game
      4. Continuing Iterations
    8. 11. Creating Your Own Game
      1. Project Management
      2. Display Methods
      3. Types of Games
      4. Final Words
  7. A. Recommended Reading
    1. The Practice of Programming
      1. The Pragmatic Programmer: From Journeyman to Master (ISBN 0-201-61622-X) by Andrew Hunt and David Thomas
      2. Code Complete Second Edition: A Practical Handbook of Software Construction (ISBN-13: 978-0735619678) by Steve McConnell
    2. The C# Language and Software Architecture
      1. CLR via C#, 3rd Edition (ISBN-13: 978-0735627048) by Jeffrey Richter
      2. Head First Design Patterns (ISBN-13: 978-0596007126) by Eric T Freeman, Elisabeth Robson, Bert Bates, and Kathy Sierra
    3. Math and Graphics Programming
      1. 3D Math Primer for Graphics and Game Development (ISBN-13: 978-1556229114) by Fletcher Dunn and Ian Parberry
      2. Computer Graphics: Principles and Practice in C (2nd Edition) (ISBN-13: 978-0201848403) by James D. Foley, Andries van Dam, Steven K. Feiner, and John F. Hughes
    4. OpenGL
      1. OpenGL Programming Guide: The Official Guide to Learning OpenGL (ISBN-13: 978-0321552624) by Dave Shreiner
      2. OpenGL Shading Language 3rd Edition by Randi J. Rost, Bill Licea-Kane, Dan Ginsburg, John M. Kessenich, Barthold Lichtenbelt, Hugh Malan, and Mike Weiblen

Chapter 5. The Game Loop and Graphics

Computer games come in many genres, from abstract puzzle games like Tetris to turn-based strategy games like Civilization to fast-paced first-person shooters like Half-Life. All these games, and all computer games, are programmed in a similar way.

How Do Games Work?

The most important way a game communicates with the player is via the TV screen or computer monitor. It’s quite common to hear about frame-rate in games. A good frame-rate is from 30 frames per second to 60 frames per second. But what does frame-rate actually mean when programming a game?

A single frame is the time between screen updates. The computer program is responsible for updating the screen with new information at least 30 times a second. Computers ...

The best content for your career. Discover unlimited learning on demand for around $1/day.