[www.ed2k.online]下載基地為您提供軟件、遊戲、圖書、教育等各種資源的ED2K電驢共享下載和MAGNET磁力鏈接下載。
設為首頁
加入收藏
首頁 圖書資源 軟件資源 游戲資源 教育資源 其他資源
 電驢下載基地 >> 图书资源 >> 計算機與網絡 >> 《C#游戲編程》(C# Game Programming: For Serious Game Creation)(Daniel Schuller)文字版,英文原版[PDF]
《C#游戲編程》(C# Game Programming: For Serious Game Creation)(Daniel Schuller)文字版,英文原版[PDF]
下載分級 图书资源
資源類別 計算機與網絡
發布時間 2017/7/10
大       小 -
《C#游戲編程》(C# Game Programming: For Serious Game Creation)(Daniel Schuller)文字版,英文原版[PDF] 簡介: 中文名 : C#游戲編程 原名 : C# Game Programming: For Serious Game Creation 作者 : Daniel Schuller 資源格式 : PDF 版本 : 文字版,英文原版 出版社 : Delmar Learning 書號 : 978-1435455566 發行時間 : 2010年 地區 : 美國 語言 : 英文 簡介 :
電驢資源下載/磁力鏈接資源下載:
全選
"《C#游戲編程》(C# Game Programming: For Serious Game Creation)(Daniel Schuller)文字版,英文原版[PDF]"介紹
中文名: C#游戲編程
原名: C# Game Programming: For Serious Game Creation
作者: Daniel Schuller
資源格式: PDF
版本: 文字版,英文原版
出版社: Delmar Learning
書號: 978-1435455566
發行時間: 2010年
地區: 美國
語言: 英文
簡介:

內容簡介:
即使有經驗的游戲開發學生有時也很難為一個偉大的游戲成為現實的設想。可用的編程語言,庫數量,生產方式可以使開發過程中最復雜和不可靠的游戲的代碼的結果。 C#中游戲程序設計:顯示學生創作的嚴肅游戲的游戲程序員如何編寫簡單,清潔,可靠的代碼循序漸進的方式,通過建立一個基本的游戲步驟。游戲是使用C#中,一個高層次的編程語言和OpenGL,為業界最喜愛的圖形顯示。學生們將獲得一個方法and用來建立良好的游戲,學習如何使用這些庫和create你的own,並最終建立您自己的滾動射擊游戲庫overview。他們甚至會找到如何開發自己的游戲的創意,你就會有一個良好的代碼基礎工作的提示和信息。 C#中游戲程序設計:為客戶提供一個嚴肅游戲的創造的所有信息類大學生,他們需要采取from概念他們的游戲理念,以completion.Copyright ©裡德Business信息,作為Reed Elsevier公司的表決保留所有權利。 - 這個文本是指印刷或無法版這個稱號了。
Editorial Reviews
Product Description
Even experienced game developers sometimes have a hard time making their vision for a great game a reality. The number of available programming languages, libraries, and production methods can make the development process overwhelming and result in complicated, unreliable game code. C# Game Programming: For Serious Game Creation shows programmers how to write simple, clean, and reliable code step-by-step through the creation of a basic game. The game is built using C#, a high-level programming language, and OpenGL, an industry favorite for graphics display. You'll get an overview of the methods and libraries used to build good games, learn how to use those libraries and create your own, and finally build your own scrolling shooter game. You'll even find tips and information on how to develop your own game ideas and you'll have an excellent code base to work with. C# Game Programming: For Serious Game Creation provides you with all the information you need to take your game ideas from concept to completion.
About the Author
Daniel Schuller is a British-born computer game developer who has worked and lived in America, Singapore, Japan, and is currently working in the United Kingdom. He has released games on the PC as well as the Xbox 360 and PlayStation 3. He has developed games for Sony, Ubisoft, Naughty Dog, RedBull, and Wizards of the Coast, and maintains a game development website at http://www.godpatterns.com. In addition to developing computer games, Daniel also studies Japanese and is interested in Artificial Intelligence, cognition, and the use of games in education.

目錄:
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xii
PART I BACKGROUND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Chapter 1 The History of C# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
C# Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Versions of C# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
C# 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Generics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Anonymous Delegates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
C# 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
LINQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Lambda Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Object Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Collection Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Local Variable Type Inference and Anonymous Types. . . . . . . . 13
C# 4.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
Dynamic Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Optional Parameters and Named Arguments. . . . . . . . . . . . . . . 15
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 2 Introducing OpenGL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Architecture of OpenGL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Vertices—The Building Blocks of 3D Graphics . . . . . . . . . . . . . . . . . . . 21
The Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
OpenGL Is Changing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
OpenGL ES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
WebGL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
OpenGL and the Graphics Card. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Shaders—Programs on the Graphics Card . . . . . . . . . . . . . . . . . . . . . . . 27
The Tao Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Chapter 3 Modern Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Pragmatic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Game Programming Traps. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
KISS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
DRY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Source Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Using Source Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39
Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Test Driven Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
Unit Testing in C# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
PART II IMPLEMENTATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Chapter 4 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Introducing Visual Studio Express—A Free IDE for C# . . . . . . . . . . . . . . . 49
A Quick Hello World. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Visual Studio Express Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Automatic Refactoring and Code Generation . . . . . . . . . . . . . . . . .53
Renaming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Creating Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Separating Chunks of Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
Subversion, an Easy Source Control Solution . . . . . . . . . . . . . . . . . . . . . . 60
Where to Get It . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Creating the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Adding to the Repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Extending Hello World. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Tao . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
NUnit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Using NUnit with a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Running Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
An Example Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Chapter 5 The Game Loop and Graphics. . . . . . . . . . . . . . . . . . . . . . . . . . . 81
How Do Games Work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
A Closer Look at the Game Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Implementing a Fast Game Loop in C# . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Adding High-Precision Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Full Screen Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Clearing the Background. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96
Vertices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98
Triangles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Coloring and Spinning the Triangle . . . . . . . . . . . . . . . . . . . . . . . . .101
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Chapter 6 Game Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
The Basic Pattern of a Game Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Handling Game State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Game State Demo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Setting the Scene with Projections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Form Size and OpenGL Viewport Size . . . . . . . . . . . . . . . . . . . . . . . . . 114
Aspect Ratio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
The Projection Matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
2D Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Sprites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Positioning the Sprite. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Managing Textures with DevIl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Textured Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Alpha Blending Sprites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Color Modulating Sprites. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
A Sprite and Renderer Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Using the Sprite Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
viii Contents
Chapter 7 Rendering Text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Font Textures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Font Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Parsing the Font Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Using the CharacterData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Rendering Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Calculating the FPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
V-Sync and Frame-Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Refining the Text Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Faster Rendering with glDrawArrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Modifying the Renderer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Profiling the Batch Draw Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Chapter 8 Game Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Trigonometric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Plotting a Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Trigonometric Functions for Special Effects . . . . . . . . . . . . . . . . . . . . 176
Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
What Is a Vector? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
The Length Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Vector Equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Vector Addition, Subtraction, and Multiplication . . . . . . . . . . . . . . . 184
Normal Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
The Dot Product Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
The Cross-Product Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Finishing Touches to the Vector Structure. . . . . . . . . . . . . . . . . . . . . . 196
Two-Dimensional Intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Tweens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
An Overview of Tweening. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
The Tween Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Using Tweens. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
What Is a Matrix? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
The Identity Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Matrix-Matrix and Vector-Matrix Multiplication . . . . . . . . . . . . . . . . 217
Chapter 7 Rendering Text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Font Textures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Font Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Parsing the Font Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Using the CharacterData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Rendering Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Calculating the FPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
V-Sync and Frame-Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Refining the Text Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Faster Rendering with glDrawArrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Modifying the Renderer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Profiling the Batch Draw Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Chapter 8 Game Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Trigonometric Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Plotting a Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Trigonometric Functions for Special Effects . . . . . . . . . . . . . . . . . . . . 176
Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
What Is a Vector? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
The Length Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Vector Equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Vector Addition, Subtraction, and Multiplication . . . . . . . . . . . . . . . 184
Normal Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
The Dot Product Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
The Cross-Product Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Finishing Touches to the Vector Structure. . . . . . . . . . . . . . . . . . . . . . 196
Two-Dimensional Intersection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Tweens . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
An Overview of Tweening. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
The Tween Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Using Tweens. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
What Is a Matrix? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
The Identity Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Matrix-Matrix and Vector-Matrix Multiplication . . . . . . . . . . . . . . . . 217
Translating and Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Rotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Inverse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Matrix Operations on Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Modifying the Sprite to Use Matrices. . . . . . . . . . . . . . . . . . . . . . . . . . 225
Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Chapter 9 Making the Game Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
A New Game Engine Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Extending the Game Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Using the Game Engine in a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Multiple Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Adding Sound Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Creating Sound Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Developing a SoundManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Improving Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Wrapping Game Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Adding Better Mouse Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Adding Keyboard Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Chapter 10 A Simple Side-Scrolling Shooting Game. . . . . . . . . . . . . . . . . 289
A Simple Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
The First Implementation Pass. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
The Start Menu State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
The Inner Game State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
The Game Over State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Developing the Inner Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Moving the Player Character. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Faking Movement with a Scrolling Background. . . . . . . . . . . . . . . . . 320
Adding Some Simple Enemies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Introducing Simple Weapons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Damage and Explosions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Managing Explosions and Enemies . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Level Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Enemy Movement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Enemy Attacks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Continuing Iterations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380 
相關資源:

免責聲明:本網站內容收集於互聯網,本站不承擔任何由於內容的合法性及健康性所引起的爭議和法律責任。如果侵犯了你的權益,請通知我們,我們會及時刪除相關內容,謝謝合作! 聯系信箱:[email protected]

Copyright © 電驢下載基地 All Rights Reserved