2-D graphics
3-D games
creating to learn XNA, 397
drawing axis for
main program calls, coding, 217–220
vertices and vertex buffer, coding, 211–215
lights, cameras, and effects, 209–210
vertices and primitives, 201–205
3ds Max software, 302
absolute position, 303
accessing Xbox LIVE features, 127
action screen for games, adding
ActionScene class, creating, 103–110
animated sprites, creating, 83–92
energy source, creating, 95–97
overview of, 82
Player class, creating, 97–102
ActionScene class
HandleClientData method, 175–177
HandleServerData method, 175–181
modifying for Zune version, 195–196
NetworkHelper object, 172
Add Existing Item dialog box (Solution Explorer), 35
ADDMETEORTIME constant, 54
AddNewMeteor method (Meteor class), 180
aggro range, 364
AI built for enemies, 372
aiming objects (Player class), 369
Akenine-Möller, Tomas, Real-Time Rendering, 289
alpha map, 275
ambient light, 209
animated model processor
extracting model's animation, 314–316
extracting model's skeleton, 313–314
overriding default Process method, 312–313
animated models, 299
AnimatedModel class
Draw method, 336
loading, 321
skeletal animation, Update method, 326–329
application to vertex shader structure, 330
uniform variables, defining, 329–330
vertex shader to pixel shader structure, 331
AnimatedModelData class, skeletal animation and, 307–311
AnimatedModelProcessor class
GetModelVertices method, 358
Process method, 359
reading and writing custom user data, 316–319
animation data classes
AnimationContent object, 314
AnimationData class, skeletal animation and, 307–309
animations
skeletal
animated model processor, 311–316
AnimatedModel class effect, 329–331
AnimatedModel class pixel processing, 333–334
AnimatedModel class vertex processing, 331–333
animation data classes, creating, 306–311
changing, and TerrainUnit class, 361–363
combining bone transformations, 325–326
converting mesh effect, 335–336
drawing model, 336
extracting model's animation, 316
overview of, 301
reading and writing custom user data, 316–319
transforming mesh vertex, 324–325
Update method (AnimatedModel class), 326–329
animators, 3
ANSI strings, 123
Apress web site, 396
arm bones of skeleton, 303
artificial intelligence game, creating to learn XNA, 398
artists, 3
aspect ratio, passing as parameter, 209
Asset Name property, 20
AttachWeapon method (Player class), 369
AttackPlayer method (Enemy class), 378
audio concepts
creating audio content with XACT, 32–34
audio effects
Rock Rain Zune version, 185
AudioEngine object, 36
audiolibrary class, creating, 71–73
Augusto, Carlos, web site of, 366
AvailableNetworkSession object, 140
axis for 3-D games, drawing
main program calls, coding, 217–220
vertices and vertex buffer, coding, 211–215
axis-aligned bounding box, 357
backbuffer, changing width and height of, 23
background
definition of, 16
bandwidth, multiplayer games and, 123
BaseCamera class
SetPerspectiveFov method, 241–243
UpdateView method, 251
BaseLight class, 253
BasicEffect class
EnableDefaultLighting method, 210
properties of, 209
rendering pipeline and, 228
World property, 222
Begin method (SpriteBatch class), 22
BeginFind method (NetworkSession class), 141–143
behavior
of network sessions, 138
of objects in game, 40
billboard, definition of, 16
bind pose configuration, 309
block scale, 262
bone representation of skeleton, 303
bone transformations, combining, 325–326
bones
of arm, 303
in skeletal animation, 301
bounding spheres, 357
bounding volumes, 246
BoundingFrustum class, 246–247
BoundingSphere class, methods of, 360
BoxIntersects method, 360
Breakout clone, creating, 397
CalculateBounds90 method, 75
CameraManager class, 254–256, 286
cameras
creating
BoundingFrustum class, 246–247
third-person
camera, updating, 252
chase parameters, setting, 248
overview of, 247
rotating around target, 250–251
Cameras folder (TPS game), 339
Cartesian 3-D coordinate systems, 199
casual players, 2
challenge, 4
characters
computer-controlled, 124
nonplayable, 338
walk of, animating, 299
ChasePlayer method (Enemy class), 378
Chat option (SendData method), 145
CheckCollision() method, Rock Rain game, 52
CheckEnterA() method, 112
chord.wav file, 33
class constructor, Rock Rain Zune version, 195–196
classes. See helper classes; specific classes
client/server connection for multiplayer games, 118–119
CloseSession method, 163
clsSprite class
code for, 18
Collides method, 26
collisions, supporting, 29
Dispose method, 22
Draw method, 20
properties of, 18
UnloadContent method, 22
CodePlex web site, 397
coding for network features of multiplayer games, 122
Collides method (clsSprite class), 26
collision detection for sprites, 26–29
collision test methods, and terrains, 294–297
color attribute (BaseLight class), 253
communication protocol for Rock Rain Live, 170–175
computer-controlled characters, 124
ConfigureGraphicsManager method (TPSGame class), 393
constraints and rules for Rock Rain, 39
Content folder, 41
content importers, formats supported by, 10
Content Pipeline
skeletal animation and
animated model processor, 311–316
AnimatedModelData class, creating, 309–311
animation data classes, creating, 306–307
AnimationData class, creating, 308–309
Keyframe class, creating, 307–308
reading and writing custom user data, 316–319
skeletal animations and, 301
ContentProcessor class, 311
ContentTypeReader class, 318–319
ContentTypeWriter class, 316–318
continuous action multiplayer games, 121
controller support, Zune platform, 184
controlling input to scene, Rock Rain Live, 161–163
converting mesh effect, 335–336
ConvertMaterial method, 335–336
coordinate systems
Counter-Strike, 124
Create Gamer Profile screen, 127
Create method (NetworkSession class), 134–139, 167
CreateAlienPlanetLevel method (LevelCreator class), 380
CreateLevel method (LevelCreator class), 380
CreateSession method
Game1 class, 163
NetworkHelper class, 135
Creators Club account, 128
Cross method (Vector3 class), 243, 245
cubes
creating with triangles, 202
first image of 3-D, 222
rotated, scaled, and lighted, 223
Cue object, 37
custom vertex format, 212
data types
dedicating threads to network messages in multiplayer games, 125
defining
fog for scene, 210
format of messages, 172
genre, 2
goals for learning XNA, 398
message types and sizes for multiplayer games, 123
technique for terrain effect, 284
third-person shooter game, 337
deploying Rock Rain Zune version, 196–198
deserialize, 304
designing game
Rock Rain, 39
detecting collisions on 2-D and 3-D systems, 26–29
device, passing as parameter, 22. See also graphics device manager
directional light, 210
DirectX Software Development Kit (Microsoft), 221
Dispose method (clsSprite class), 22
disposing objects when program ends, 22
DoGameLogic() method, Rock Rain game, 52–53
double buffering, 23
downloading XNA Game Studio and Visual C# Express Edition, 5
Draw method
AnimatedModed class, 336
clearing device and filling window with single color, 13
clsSprite class, 20
DrawableGameComponent class, 44–47
GameComponent class, 49
GameScreen class, 391
Microsoft.Xna.Framework.Game class, 12
overloads, 20
SpriteBatch class, 22
TerrainUnit class, 363
Draw Primitives method, 202
DrawableGameComponent class, code for, 44–47
DrawIndexedPrimitives method (GraphicsDevice class), 288
drawing
axis for 3-D games
main program calls, coding, 217–220
vertices and vertex buffer, coding, 211–215
sprites
Sprite class, creating, 18
window size, changing, 23
triangles, 205
EarthSculptor, 264
ecosystem of game, 5
Effect class
BasicEffect and, 210
effect material for terrain effect, setting, 284–288
overview of, 235
ElapsedGameTime property (GameTime class), 12
ElapsedRealTime property (GameTime class), 12–13
EnableDefaultLighting method (BasicEffect class), 210
EndFind method (NetworkSession class), 141–143
ending criteria for game, 4
Enemy class
AttackPlayer method, 378
attributes of, 373
ChasePlayer method, 378
overview of, 372
SetAnimation method, 362
EnemyAnimations enumeration, 361
energy source GameComponent object, creating, 95–97
Entertainment Software Association, 2
equations, skeletal animation
combining bone transformations, 325–326
mesh vertex, transforming, 324–325
Evangelista, Bruno, web site of, 396
experience of game developer, 190
exporting models with skeletal animation, 301
extending terrain effect with normal mapping
overview of, 289
vertex processing for, 290
ExtractAnimations method (ModelProcessor class), 314–316
ExtractSkeletonAndAnimations method (ModelProcessor class), 313–314
F4 key (image properties), 20
FBX (Autodesk) format, 301
finalization of game, 11
Find method (NetworkSession class), 139–141
flexible vertex format, 212
fog for scene, defining, 210
FollowPlayer camera, 381
fonts, third-party, 55
forgiveness, 4
format of messages, defining, 172
formats supported by content importers, 10
FPSCamera, 381
front side of triangle, determining, 205
FX Composer (NVIDIA), 240
game development
experience and, 190
important points regarding, 395–396
game engine, starting for third-person shooter game
animated model processor, 339–340
cameras, lights, and transformations, 339
overview of, 338
sky, 340
SkyBox, 340
SkyDome, 340
Terrain class, 339
game logic, creating for Rock Rain, 52–54
Game object, Services property, 286
game service, 47
Game1 class
controlling state of, 110
device and content manager initialization, 9
HandleActionInput method, 170–172
HandleScenesInput method, 154
HandleStartSceneInput method, 153
modifying for Zune version, 193–195
overview of, 8
renaming, 9
starting, 9
GameBase namespace, 338
GameComponent class for Rock Rain game, creating, 43–49
GameComponent objects
to animate sprites, 83
management classes for groups of, 92
scenes as, 62
GameLevel struct, GameLogic namespace, 379
GameLogic classes
AnimatedModelProcessor
GetModelVertices method, 358
Process method, 359
Enemy, SetAnimation method, 362
GameScreen, 351
overview of, 351
Player, SetAnimation method, 362
TerrainUnit
constructor of, 353
Draw method, 363
Jump method, 354
Load method, 353
ReceiveDamage method, 361
SetAnimation method, 362
Update and NormalizeBaseVectors methods, 356–357
GameLogic namespace
description of, 338
GameLevel struct, 379
GamePadState class, 346
gameplay, third-person shooter game, designing, 337–338
Gamer Services component, starting, 127–131
GamerJoinedEventHandler method, 168
games
See also 3-D games; multiplayer games; screens for game; specific games
axis for 3-D, drawing
main program calls, coding, 217–220
vertices and vertex buffer, coding, 211–215
Rock Rain, 39
ecosystem of, 5
ending criteria for, 4
finalization of, 11
goals of, 4
objects in, 40
planning
genre, 2
playability of, 4
polishing, 5
role playing, tiles and, 16
saving, 5
storyline for, 4
Games for Windows LIVE opening screen, 128
GameScreen class
attributes of, 384
constructor of, 385
description of, 351
Draw method, 391
initializing game objects, 385
UpdateWeaponnTarget method, 387
UpdateWeaponTarget method, 390–391
GameSettings struct, SettingsManager class, 348
GameTime class, properties of, 12
GenerateTerrainIndices method (Terrain class), 268–269
GenerateTerrainMesh method (Terrain class), 265–267
GenerateTerrainNormals method (Terrain class), 272–273
GenerateTerrainTangentBinormal method (Terrain class), 273–275
GenerateTerrainVertices method (Terrain class), 269–272
generating
height maps, 264
terrains
normal vector of vertices and, 272–273
tangent and binormal vectors of vertices and, 273–275
genre, defining, 2
geometry and 2-D coordinate systems, 17
GetBound() method (GameComponent class), 48
GetKeyboardDictionary method (SettingsManager class), 349
GetLeftThumbStick method (InputHelper class), 347
GetModelVertices method (AnimatedModelProcessor class), 358
GetRightThumbStick method (InputHelper class), 347
GetState method
KeyBoard object, 31
Mouse object, 31
GetTextureMaterial method, 382
defining, for learning XNA, 398
of game, 4
GPUs (graphics processing units), shaders and, 228
graphic cards, matrices and, 208
graphics device manager, 9
graphics processing units (GPUs), shaders and, 228
GraphicsDevice class, DrawIndexedPrimitives method, 288
GraphicsDevice property, 13
Grootjans, Riemer, XNA 3.0 Game Programming Recipes, 396
group-based network topology for multiplayer games, 120
Haines, Eric, Real-Time Rendering, 289
Halo, 124
HandleActionInput method (Game1 class), 170–172
HandleActionInput() method, 113
HandleClientData method (ActionScene class), 175–177
HandleDamages method (ActionScene class), 196
HandleDamages() method, 107
HandleInput method (Player class), 190
HandleNetworkSceneInput method, 160–161
HandleNotSigned method, 162
HandlePowerSourceSprite() method, 107–108
HandleScenesInput method (Game1 class), 154
HandleScenesInput() method, 111
HandleServerData method (ActionScene class), 175–181
HandleSigned method, 162
HandleStartSceneInput method (Game1 class), 153, 194
HandleStartSceneInput() method, 112
hardcore players, 2
heavy gamers, 2
height maps
building terrains from, 261–263
for terrains, loading, 264–266
generating, 264
help screen for game, adding, 66–69
Helper classes
InputHelper
attributes and constructor of, 344
GetLeftThumbStick method, 347
GetRightThumbStick method, 347
IsKeyJustPressed method, 345
IsKeyPressed method, 345
overview of, 343
Update method, 344
overview of, 343
SettingsManager
GameSettings struct, 348
GetKeyboardDictionary method, 349
KeyboardSettings struct, 347–348
Read method, 349
Save method, 349
Helpers namespace, 338
HelpScene class, modifying for Zune version, 186–187
hiding latency from players of multiplayer games, 123–124
hierarchy, skeleton, 309
High Level Shading Language (HLSL)
functions, 233
input data, 231
overview of, 230
simple shader, creating, 234–235
HookSessionEvents method, 167
host, multiplayer, creating, 126
image editor web sites, 19
images
Properties window for, 20
putting in scenes, 67
for sprite, adding to project, 19
with transparent sections, 19
importing models with skeletal animation, 301
IndexBuffer for terrain mesh, 267
indices, mesh, 266
Infinite in the Looping properties (XACT), 34
infrequent gamers, 2
Initialize method, 11
input data (HLSL), 231
input from user
keyboard, 31
mouse, 31
overview of, 29
input to scene, controlling in Rock Rain Live, 161–163
InputHelper class
attributes and constructor of, 344
GetLeftThumbStick method, 347
GetRightThumbStick method, 347
IsKeyJustPressed method, 345
IsKeyPressed method, 345
overview of, 343
Update method, 344
Intersects method
BoundingSphere class, 360
intrinsic functions (HLSL), 233–234
IsFixedTimeStep property (Game class), 12
IsKeyJustPressed method (InputHelper class), 345
IsKeyPressed method (InputHelper class), 345
IsRunningSlowly property (GameTime class), 13
joining multiplayer session
JoinSession method, 163
Jump method (TerrainUnit class), 354
keyboard, user input from, 31
KeyboardSettings struct (SettingsManager class), 347–348
Keyframe class, skeletal animation and, 307–308
lag, 249
lastRayPosition variable, 295
latency, hiding from players of multiplayer games, 123–124
Leal de Farias, José, web site of, 396
learning XNA, steps for, 397–398
Left shoulder bone animation, 323
left-handed coordinate systems, 199
Lerp method (Vector3 class), 249
level designers, 3
LightManager class, 256–257, 286
LightMaterial class, creating, 238
lightPosition parameter, 237
lights
BaseLight class, 253
Lights folder (TPS game), 339
line list, primitives rendered as, 203
line strip, primitives rendered as, 203
linear interpolation, 249
linear search to find one point inside and another outside terrain, 295
listings (code)
clsSprite class, 18
GameComponent object
scoreboard, 92
PowerSource GameComponent, 95–97
LIVE (Microsoft Xbox LIVE)
Community Games, 126
Load method
SkyDome class, 342
TerrainUnit class, 353
LoadContent method
PlayerWeapon class, 366
loading
model as new content into sample program, 221
Lobão, Alexandre, web site of, 396
local player, 151
LocalNetworkGamer class, SendData and ReceiveData methods of, 144–147
Location field (New Project dialog box), 6
loop, main program logic running in, 7, 11–13
Main function (Program class), 8
main program calls, coding for 3-D axis, 217–220
management classes for groups of GameComponents, 92
mapping
3-D objects to 2-D screen, 200–201
margin of screen, 58
marine model, 366
MaterialContent object, 335
materials, effects and, 238–239
matrices
projection, creating, 209, 241
storing information as, 304
Matrix class, operations available in, 208
Maya software, 302
menu changes, Rock Rain Zune version, 187
menu component for opening screen of game, creating, 73–78
description of, 228
for terrain
mesh effect, converting, 335–336
mesh vertex, transforming, 324–325
Meteor class
adding network support for, 178–181
AddNewMeteor method, 180
modifying for Zune version, 188–190
PutinStartPosition method, 178
meteors, creating for Rock Rain, 49–52
MeteorsManager class
modifying for Zune version, 192
Start method, 179
Microsoft
Cross-Platform Audio Creation Tool (XACT), 32–34
Developer Network (MSDN) site, Platformer Starter Kit example, 16
DirectX Software Development Kit, 221
Xbox LIVE
Community Games, 126
Microsoft.Xna.Framework.Game class
Game1 object, 8
Update and Draw methods, 12
Microsoft.Xna.Framework.GamerServices namespace, 126–127. See also Gamer Services component
Microsoft.Xna.Framework.Net namespace, 126–127
mobile devices
usability issues for games on, 184
Zune platform, 183
model formats supported, 301
modelers, 3
ModelMesh class, 221
ModelProcessor class
ExtractAnimations method, 314–316
ExtractSkeletonAndAnimations method, 313–314
overriding Process method of, 312–313
skeletal animation and, 311–312
monsters, 338
mouse, user input from, 31
Move method (Enemy class), 377–378
moving sprite on screen, 24–25
multiplayer games
See also Rock Rain Live
difficulty coding, 117
Framework.Net and Framework.GamerServices namespaces, 126–127
helper messages for keys in, 148
NetworkHelper class
CreateSession method, 135
Update method, 135
NetworkSession class
BeginFind and EndFind methods, 141–143
sending and receiving messages, 144–147
starting Gamer Services component, 127–131
technical tips for
code for network features, 122
define message types and sizes, 123
hide latency from players, 123–124
include single-player features, 124
plan before starting, 122
use different threads to handle network messages, 125
testing, 125
turn-based vs. real-time, 121
multiplication for matrices, 207
multitexturing, terrains and, 275
music, adding
to Rock Rain Zune version, 185
musicians, 3
namespaces
Framework.Net and Framework.GamerServices, 126–127
GameBase, 338
Helpers, 338
navigating between scenes, 110–114
Net Rumble starter kit, 124
Network Game Scene, 160
network games, creating to learn XNA, 398. See also Rock Rain Live
network sessions, behavior of, 138
network topology for multiplayer games, 117–120
network-enabled games. See multiplayer games
NetworkHelper class
CreateSession method, 135
Update method, 135
NetworkHelper object, declaring in ActionScene class, 172
NetworkSession class
BeginFind and EndFind methods, 141–143
NetworkSession.SimulatedLatency command, 124
NetworkSession.SimulatedPacketLoss command, 124
New Project dialog box, 6
New Wave Bank option (XACT), 32
NodeContent object, 304–305, 312
nonplayable character (NPC), 338
normal mapping
extending terrain effect with
overview of, 289
vertex processing for, 290
NormalizeBaseVectors method (TerrainUnit class), 356–357
notify.wav file, 33
NPC (nonplayable character), 338
NPD Group
best-selling genres, 2
market categories, 1
NVIDIA FX Composer, 240
object transformations, Transformation class, 258–259
object-oriented bounding box, 357
objects in game, 40
online multiplayer games. See multiplayer games
opening screen
for games, adding
audiolibrary class, creating, 71–73
menu component, creating, 73–78
overview of, 70
StartScene class, attributes for, 78–82
organizing Rock Rain Zune version, 184–185
orthogonal projections, 201, 209
PacketReader class object, 170, 173
PacketWriter class object, 170–172
parallax scrolling, 16
passes, effects and, 235
pausing
network games, 170
scenes, 62
PeekChar method, 173
peer-to-peer connection for multiplayer games, 117–118
perspective projections, 200, 208
pixel processing
description of, 228
pixel shaders
See also techniques
description of, 229
semantics, 232
planning
games
genre, 2
multiplayer games, 122
Rock Rain Zune version, 183–184
Play method, 37
playability of game, 4
PlayCue method, 36
Player class
adding network support for, 176–177
aiming objects, 369
AttachWeapon method, 369
attributes of, 367
modifying for Zune version, 190–192
overview of, 366
for Rock Rain game, creating, 97–102
SetAnimation method, 362
UpdateChasePosition method, 368–369
UpdateWaistBone method, 370
Player GameComponent, code for, 97–102
Player object, Rock Rain Live, 174
player status message, 175
player's GameComponent, creating for Rock Rain, 42–49
PlayerAnimations enumeration, 361
players
See also multiplayer games
local and remote, 151
of Rock Rain Live, synchronizing, 175–181
types of, 2
attributes of, 365
constructor of, 365
LoadContent method, 366
overview of, 364
Update method, 366
point list, vertices rendered as, 203
polishing game, 5
PowerSource class
adding network support for, 177–178
modifying for Zune version, 187–188
PowerSource GameComponent, code for, 95–97
PreferredBackBufferWidth property, 23
primitives, and 3-D games, 201–205
Process method
AnimatedModelProcessor class, 359
ModelProcessor class, overriding, 312–313
processors, animated model
extracting model's animation, 314–316
extracting model's skeleton, 313–314
overriding default Process method, 312–313
Program class, Main function, 8
programmers, 3
programming concepts
finalization of game, 11
general structure of game, 7–9
project management, 3
project, creating, 40
projection matrix, creating, 209, 241
projections
properties of clsSprite class, 18
Properties window, 20
Psionic web site, 372
PutinStartPosition method (Meteor class), 178
PutinStartPosition() method (GameComponent class), 48
querying terrain height, 291–294
rasterization, shaders and, 229
ray and terrain collision, 294–297
ray variable, 295
Read method (SettingsManager class), 349
reading custom user data (AnimatedModelProcessor class), 316–319
real-time multiplayer games, 121
Real-Time Rendering, Second Edition (Akenine-Möller and Haines), 289
ReceiveDamage method (TerrainUnit class), 361
ReceiveData method (LocalNetworkGamer class), 144–147
registering experience, 5
releasing paused network game, 170
remote player, 151
renaming Game1 class, 9
rendering terrains
multitexturing, 275
replayability of game, 4
rewards, 5
right-handed coordinate systems, 199
ring network topology for multiplayer games, 119
Rock Rain game
action screen, adding
ActionScene class, creating, 103–110
animated sprites, creating, 83–92
energy source, creating, 95–97
overview of, 82
Player class, creating, 97–102
design of, 39
enhancing, 61
modifying and deploying to Xbox 360, 57–59
navigating between scenes, 110–114
opening screen, adding
audiolibrary class, creating, 71–73
menu component, creating, 73–78
overview of, 70
StartScene class, attributes for, 78–82
player's GameComponent, creating, 42–49
project, creating, 40
scoreboard, adding, 55
vibration effect, adding, 56–57
Rock Rain Live
adding support for, 152
communication protocol, 170–175
controlling input to scene, 161–163
opening screen, changing, 153–155
synchronizing players, 175–181
role playing games (RPG), tiles and, 16
rotating
waist bone of player model, 369
RumblePad() method, Rock Rain game, 57
Run method, 8
runtime, handling skeletal animation model at, 319–320
safe area, 58
sampler type (HLSL), 230
Save method (SettingsManager class), 349
saving game, 5
scalar types (HLSL), 230
ScatterEnemies method, 383–384
scene for Rock Rain Live, creating, 155–160
scenes. See screens for game
Score GameComponent, code for, 92–95
scoreboard, adding to Rock Rain, 55
screen coordinate systems, 2-D graphics and, 16–17
screen resolution, and Zune platform, 184
screen, margin of, 58
screens for game
action screen
ActionScene class, creating, 103–110
animated sprites, creating, 83–92
energy source, creating, 95–97
overview of, 82
Player class, creating, 97–102
flow of, 62
opening screen
audiolibrary class, creating, 71–73
menu component, creating, 73–78
overview of, 70
StartScene class, attributes for, 78–82
script writers, 3
scrolling background, 16
selling game in Xbox LIVE Community Games area, 126
SendData method (LocalNetworkGamer class), 144–147
SendDataOptions.InOrder flag, 125
SendDataOptions.Reliable flag, 125
serialize, 304
Services property (Game object), 286
SessionEndedEventHandler method, 168
sessions, creating for Rock Rain Live, 166–170
sessions, multiplayer
finding and joining
sending and receiving messages, 144–147
SessionState property, 143–144
SetAnimation method, 362
SetChaseParameters method (ThirdPersonCamera class), 248
SetEffectMaterial method (SkyDome class), 342–343
SetEffectMaterial method (Terrain class), 286–288
SetLookAt method (BaseCamera class), 243–244
SetPerspectiveFov method (BaseCamera class), 241–243
SettingsManager class
GameSettings struct, 348
GetKeyboardDictionary method, 349
KeyboardSettings struct, 347–348
Read method, 349
Save method, 349
SetVibration method
shaders
authoring tools for, 240
description of, 228
effects and, 236
High Level Shading Language
functions, 233
input data, 231
passes and, 236
rasterization and, 229
rendering pipeline and, 228
Sharp Games community sites, 396
Show method (StartScene class), 192
ShowScene() method, 114
SignInGamer method (NetworkHelper class), 133–134
single-player features, including in multiplayer games, 124
AnimatedModel class
AnimatedModel class effect
application to vertex shader structure, 330
uniform variables, defining, 329–330
vertex shader to pixel shader structure, 331
combining bone transformations, 325–326
Content Pipeline and
animated model processor, 311–316
AnimatedModelData class, creating, 309–311
animation data classes, creating, 306–307
AnimationData class, creating, 308–309
Keyframe class, creating, 307–308
reading and writing custom user data, 316–319
converting mesh effect, 335–336
drawing model, 336
extracting model's animation, 316
overview of, 301
transforming mesh vertex, 324–325
Update method (AnimatedModel class), 326–329
skeleton model
arm bones of, 303
storing, 302
skinning, 299
sky (TPS game), 340
skybox, 340
SkyBox (TPS game), 340
skydome, 340
SkyDome (TPS game), 340
SkyDome class
creating, 340
Load method, 342
SetEffectMaterial method, 342–343
Update method, 342
Solution Explorer
Add Existing Item dialog box, 35
for project, 6
Sound Banks item (XACT), 33
sound concepts
creating audio content with XACT, 32–34
sound effects
Rock Rain Zune version, 185
SoundBank object, 36
spider model, 372
sprite
collision detection for, 26–29
definition of, 15
drawing
Sprite class, creating, 18
window size, changing, 23
SpriteBatch class
Begin method, 22
description of, 20
Draw method, 22
rendering pipeline and, 228
SpriteBatch object, 9
SpriteLIP GPL, 43
Start Debug icon, 6
Start method (MeteorsManager class), 179
start scene for Rock Rain Live, 151
Start() method (GameComponent class), 48
starting
STARTMETEORCOUNT constant, 52
StartScene class
modifying for Zune version, 192–193
state of game, sharing in multiplayer game, 151
Stop method, Cue object, 37
storing
information as matrix, 304
skeleton model, 302
storyline for game, 4
support for network games, adding, 152
synchronizing
game state in multiplayer game, 151
players of Rock Rain Live, 175–181
SystemLink, 167
tangent base, 273
target, rotating camera around, 250–251
team for game development, members of, 2–3
technical design of third-person shooter game, 338
technique for terrain effect, defining, 284
techniques, effects and, 235
terminology of 2-D graphics, 15–16
Terragen procedural generation tool, 264
Terrain class
attributes, 264
GenerateTerrainIndices method, 268–269
GenerateTerrainMesh method, 265–267
GenerateTerrainNormals method, 272–273
GenerateTerrainTangentBinormal method, 273–275
GenerateTerrainVertices method, 269–272
heightScale attribute, 270
SetEffectMaterial method, 286–288
for TPS game, 339
terrain effect
effect material, setting, 284–288
extending with normal mapping
overview of, 289
vertex processing for, 290
technique for, defining, 284
vertex input and output structures for, 280
terrain grid
block in, 292
object position relative to, 291
TerrainMaterial class, 265, 284–288
See also terrain effect
building from height maps, 261–263
collision test methods, 294–297
generating
normal vector of vertices and, 272–273
tangent and binormal vectors of vertices and, 273–275
overview of, 261
rendering
multitexturing, 275
TerrainUnit class
constructor of, 353
Draw method, 363
Jump method, 354
Load method, 353
ReceiveDamage method, 361
SetAnimation method, 362
Update and NormalizeBaseVectors methods, 356–357
testers, 3
testing
multiplayer games, 125
Tetris clones, creating, 397
texture coordinates for grid of vertices, 270
Texture2D class, 18
TextureMaterial class, creating, 239
textures
definition of, 15
model files and, 223
Rock Rain game, 70
Rock Rain Zune version, 185
third-party fonts, 55
third-person shooter (TPS) game
defining, 337
Enemy class
AttackPlayer method, 378
attributes of, 373
ChasePlayer method, 378
overview of, 372
examples of, 337
game engine, starting
animated model processor, 339–340
cameras, lights, and transformations, 339
overview of, 338
sky, 340
SkyBox, 340
SkyDome, 340
Terrain class, 339
GameLogic classes
GameScreen, 351
GameLogic namespace, GameLevel struct, 379
attributes of, 384
constructor of, 385
Draw method, 391
initializing game objects, 385
UpdateWeaponTarget method, 387–391
Helper classes
Player class
aiming objects, 369
AttachWeapon method, 369
attributes of, 367
overview of, 366
UpdateChasePosition method, 368–369
UpdateWaistBone method, 370
PlayerWeapon class
attributes of, 365
constructor of, 365
LoadContent method, 366
overview of, 364
Update method, 366
SkyDome class
creating, 340
Load method, 342
SetEffectMaterial method, 342–343
Update method, 342
ThirdPersonCamera class
overview of, 247
rotating camera around target, 250–251
SetChaseParameters method, 248
Update method, 252
UpdateFollowPosition method, 248–250
threads, dedicating to network messages in multiplayer games, 125
3-D games
creating to learn XNA, 397
drawing axis for
main program calls, coding, 217–220
vertices and vertex buffer, coding, 211–215
lights, cameras, and effects, 209–210
vertices and primitives, 201–205
thumbstick
aim mode and, 387
GamePadState class and, 346–347
normal mode and, 389
Tile Horizontally option (XACT), 33
tiled map, 16
tiles, 16
tools
for generating height maps, 264
procedural generation, 264
shader authoring, 240
to support skeletal (or bone) animation, 301
TotalGameTime property (GameTime class), 13
TPS game. See third-person shooter (TPS) game
Transformation class, 258–259, 339
transformation matrices. See matrices
transformations, matrices and, 304
transforming mesh vertex, 325
transformMatrix parameter (Begin method), 23
transparency map, 275
transparent areas of image files, creating, 19
triangle fan, primitives rendered as, 205
triangle list, primitives rendered as, 204
triangle strip, primitives rendered as, 204
triangles
in 2-D coordinate system, 17
as base rendering primitives, 202
drawing, 205
indexing grid vertices to create, 268
moving up Y axis, 206
rasterized, 229
in screen coordinates, 17
turn-based multiplayer games, 121
tweening, 300
2-D graphics
TwoPlayers attribute (ActionScene class), 195
Unicode, 123
uniform input data, 231
unit collision tests, TerrainUnit class, 359–361
unit collision volume, TerrainUnit class, 357–359
Update method
DrawableGameComponent class, 44–48
Game class, 48
Game1 class, 24
InputHelper class, 344
Microsoft.Xna.Framework.Game class, 12
NetworkHelper class, 135
PlayerWeapon class, 366
predefined code for ending game, 13
SkyDome class, 342
StartScene class, 192
ThirdPersonCamera class, 252
UpdateChasePosition method (Player class), 368–369
UpdateCollision method (BoundingSphere class), 360
UpdateFollowPosition method (ThirdPersonCamera class), 248–250
UpdateFrustum method (BoundingFrustum class), 246
UpdateHeight method (TerrainUnit class), 354–356
UpdateInput method (GameScreen class), 387–390
UpdateMenus method, 159
UpdateNetworkData method, 176
UpdateView method (BaseCamera class), 251
UpdateWaistBone method (Player class), 370
UpdateWeaponTarget method (GameScreen class), 390–391
usability issues, and games for mobile devices, 184
keyboard, 31
mouse, 31
overview of, 29
using statement, creating object in, 8
varying input data, 231
Vector2 class, 18
Vector3 class
Lerp method, 249
Vector3 data type
methods of, 205
shortcuts of, 206
vertices and, 201
vectors
camera coordinate system, 244–246
velocity property (clsSprite class), 24–25
vertex buffer, coding for 3-D axis, 211–215
vertex grid, 6×6, created over x,z plane, 261
vertex processing
for normal mapping, 290
vertex shaders
See also techniques
description of, 228
semantics, 231
vertex structures, predefined, 266
VertexBuffer for terrain mesh, 267
VertexPositionNormalTangentBinormalTexture, defining, 266–267
vertices
moving triangle up Y axis and, 206
normalizing weights of, 325
representing as matrices, 207
terrains
generating position and texture coordinate, 269–272
tangent and binormal vectors, 273–275
vibration effect, adding to Rock Rain, 56–57
viewport, aspect ratio and, 209
Visual C# Express Edition, downloading, 5
walking character, animating, 299
Wander method (Enemy class), 376–377
Wandering state (Enemy class), 375–376
wave bank operations (XACT), 33
WaveBank object, 36
web sites
Apress, 396
Augusto, Carlos, 366
Entertainment Software Association, 2
image editors, 19
Microsoft Developer Network
Platformer Starter Kit example, 16
Psionic, 372
Sharp Games community sites, 396
SpriteLIB GPL, 43
Xbox LIVE Community Games, 126
weights of vertex, normalizing, 325
window size, changing, 23
world matrix, 209
World property (BasicEffect class), 222
world transformation, 258
writing custom user data (AnimatedModelProcessor class), 316–318
X (DirectX File) format, 301
XACT (Microsoft Cross-Platform Audio Creation Tool), 32–34
Xbox 360
gamepad, user input from, 30–31
modifying and deploying Rock Rain to, 57–59
skeletal animation and, 307
Xbox LIVE (Microsoft)
Community Games, 126
XNA 3.0 Game Programming Recipes (Grootjans), 396
XNA Creators Club
Billboards sample, 16
XNA Game Studio, downloading, 5
XNA Game Studio Device Center with Zune added, 196
Zune platform
menu changes for Rock Rain version for, 187
modifying classes for Rock Rain version for
MeteorsManager class, 192
3.143.5.201