INDEX

Numerics A B C D E F G H I J K L M N O P Q R S T U V W X Z

Numerics

2-D graphics

coordinate systems, 1617

terminology for, 1516

3-D games

coordinate systems, 199201

creating to learn XNA, 397

drawing axis for

basic effect, coding, 216217

main program calls, coding, 217220

overview of, 210211

vertices and vertex buffer, coding, 211215

lights, cameras, and effects, 209210

models and meshes, 220223

vectors and matrices, 205209

vertices and primitives, 201205

3ds Max software, 302

A

absolute position, 303

accessing Xbox LIVE features, 127

action screen for games, adding

ActionScene class, creating, 103110

animated sprites, creating, 8392

energy source, creating, 9597

overview of, 82

Player class, creating, 97102

scoreboard, creating, 9295

ActionScene class

code for, 103110

HandleClientData method, 175177

HandleServerData method, 175181

modifying for Zune version, 195196

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

creating, 311312

extracting model's animation, 314316

extracting model's skeleton, 313314

overriding default Process method, 312313

TPS game, 339340

animated models, 299

AnimatedModel class

creating, 319320

Draw method, 336

Load method, 322323

loading, 321

skeletal animation, Update method, 326329

AnimatedModel class effect

application to vertex shader structure, 330

pixel processing, 333334

uniform variables, defining, 329330

vertex processing, 331333

vertex shader to pixel shader structure, 331

AnimatedModelData class, skeletal animation and, 307311

AnimatedModelProcessor class

GetModelVertices method, 358

Process method, 359

reading and writing custom user data, 316319

animating sprites, 8392

animation data classes

AnimatedModelData, 309311

AnimationData, 308309

Keyframe, 307308

overview of, 306307

AnimationContent object, 314

AnimationData class, skeletal animation and, 307309

animations

keyframed, 300301

skeletal

animated model processor, 311316

AnimatedModel class, 319323

AnimatedModel class effect, 329331

AnimatedModel class pixel processing, 333334

AnimatedModel class vertex processing, 331333

animation data classes, creating, 306311

changing, and TerrainUnit class, 361363

combining bone transformations, 325326

Content Pipeline and, 304306

converting mesh effect, 335336

drawing model, 336

equations for, 323324

extracting model's animation, 316

overview of, 301

reading and writing custom user data, 316319

transforming mesh vertex, 324325

Update method (AnimatedModel class), 326329

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, 3234

using audio in games, 3537

audio effects

Rock Rain game, 40, 5455

Rock Rain Zune version, 185

AudioEngine object, 36

audiolibrary class, creating, 7173

Augusto, Carlos, web site of, 366

AvailableNetworkSession object, 140

axis for 3-D games, drawing

basic effect, coding, 216217

main program calls, coding, 217220

overview of, 210211

vertices and vertex buffer, coding, 211215

axis-aligned bounding box, 357

B

backbuffer, changing width and height of, 23

background

definition of, 16

drawing, for Rock Rain, 4142

bandwidth, multiplayer games and, 123

BaseCamera class

SetLookAt method, 243244

SetPerspectiveFov method, 241243

UpdateView method, 251

BaseLight class, 253

BasicEffect class

coding for 3-D axis, 216217

EnableDefaultLighting method, 210

properties of, 209

rendering pipeline and, 228

World property, 222

Begin method (SpriteBatch class), 22

BeginFind method (NetworkSession class), 141143

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, 325326

bones

of arm, 303

in skeletal animation, 301

bounding boxes, 2627, 357

bounding spheres, 357

bounding volumes, 246

BoundingFrustum class, 246247

BoundingSphere class, methods of, 360

BoxIntersects method, 360

Breakout clone, creating, 397

C

CalculateBounds90 method, 75

CameraManager class, 254256, 286

cameras

3-D games and, 209210

creating

BaseCamera class, 241244

BoundingFrustum class, 246247

coordinate system, 244246

management of, 254256

orienting, 243244

third-person

camera, updating, 252

chase parameters, setting, 248

overview of, 247

position, updating, 248250

rotating around target, 250251

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, 195196

classes. See helper classes; specific classes

client/server connection for multiplayer games, 118119

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

velocity property, 2425

CodePlex web site, 397

coding for network features of multiplayer games, 122

Collides method (clsSprite class), 26

collision detection for sprites, 2629

collision test methods, and terrains, 294297

color attribute (BaseLight class), 253

communication protocol for Rock Rain Live, 170175

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

description of, 911

skeletal animation and

animated model processor, 311316

AnimatedModelData class, creating, 309311

animation data classes, creating, 306307

AnimationData class, creating, 308309

Keyframe class, creating, 307308

overview of, 304306

reading and writing custom user data, 316319

skeletal animations and, 301

ContentProcessor class, 311

ContentTypeReader class, 318319

ContentTypeWriter class, 316318

continuous action multiplayer games, 121

controller support, Zune platform, 184

controlling input to scene, Rock Rain Live, 161163

converting mesh effect, 335336

ConvertMaterial method, 335336

coordinate systems

2-D games, 1617

3-D games, 199201

camera, 244246

Counter-Strike, 124

Create Gamer Profile screen, 127

Create method (NetworkSession class), 134139, 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

D

data types

HLSL, 230231

Vector3, 201, 205206

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

NetworkHelper class, 132133

technique for terrain effect, 284

third-person shooter game, 337

deploying Rock Rain Zune version, 196198

deserialize, 304

designing game

Rock Rain, 39

third-person shooter, 337338

detecting collisions on 2-D and 3-D systems, 2629

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, 5253

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, 4447

GameComponent class, 49

GameScreen class, 391

Microsoft.Xna.Framework.Game class, 12

overloads, 20

SkyDome class, 342343

SpriteBatch class, 22

TerrainUnit class, 363

Draw Primitives method, 202

DrawableGameComponent class, code for, 4447

DrawIndexedPrimitives method (GraphicsDevice class), 288

drawing

axis for 3-D games

basic effect, coding, 216217

main program calls, coding, 217220

overview of, 210211

vertices and vertex buffer, coding, 211215

sprites

onscreen, 2023

Sprite class, creating, 18

sprite image, adding, 1920

window size, changing, 23

terrains, 288291

triangles, 205

E

EarthSculptor, 264

ecosystem of game, 5

Effect class

BasicEffect and, 210

overview of, 236237

effect material for terrain effect, setting, 284288

effects

3-D games, 209210

helper classes, 237238

materials and, 238239

overview of, 235

ElapsedGameTime property (GameTime class), 12

ElapsedRealTime property (GameTime class), 1213

EnableDefaultLighting method (BasicEffect class), 210

EndFind method (NetworkSession class), 141143

ending criteria for game, 4

Enemy class

AttackPlayer method, 378

attributes of, 373

ChasePlayer method, 378

Move method, 377378

overview of, 372

SetAnimation method, 362

Update method, 373375

Wander method, 376377

Wandering state, 375376

EnemyAnimations enumeration, 361

energy source GameComponent object, creating, 9597

Entertainment Software Association, 2

equations, skeletal animation

combining bone transformations, 325326

mesh vertex, transforming, 324325

overview of, 323324

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

pixel processing for, 290291

vertex processing for, 290

ExtractAnimations method (ModelProcessor class), 314316

ExtractSkeletonAndAnimations method (ModelProcessor class), 313314

F

F4 key (image properties), 20

F5 key (run game), 6, 42

FBX (Autodesk) format, 301

finalization of game, 11

Find method (NetworkSession class), 139141

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

frustum, 241, 246247

functions, HLSL, 233234

FX Composer (NVIDIA), 240

G

game development

experience and, 190

important points regarding, 395396

game engine, starting for third-person shooter game

animated model processor, 339340

cameras, lights, and transformations, 339

overview of, 338

sky, 340

SkyBox, 340

SkyDome, 340

Terrain class, 339

game logic, creating for Rock Rain, 5254

Game object, Services property, 286

game service, 47

Game1 class

controlling state of, 110

device and content manager initialization, 9

HandleActionInput method, 170172

HandleScenesInput method, 154

HandleStartSceneInput method, 153

modifying for Zune version, 193195

overview of, 8

renaming, 9

starting, 9

GameBase namespace, 338

GameComponent class for Rock Rain game, creating, 4349

GameComponent objects

to animate sprites, 83

help scene, 6869

management classes for groups of, 92

meteor, 8588

MeteorsManager, 8892

Player, 97102

PowerSource, 9597

scenes as, 62

Score, 9295

GameLevel struct, GameLogic namespace, 379

GameLogic classes

AnimatedModelProcessor

GetModelVertices method, 358

Process method, 359

Enemy, SetAnimation method, 362

GameScreen, 351

LevelCreator, 379384

overview of, 351

Player, SetAnimation method, 362

TerrainUnit

animations, changing, 361363

collision tests, 359361

collision volume, 357359

constructor of, 353

Draw method, 363

Jump method, 354

Load method, 353

overview of, 351353

ReceiveDamage method, 361

SetAnimation method, 362

Update and NormalizeBaseVectors methods, 356357

UpdateHeight method, 354356

GameLogic namespace

description of, 338

GameLevel struct, 379

GamePad class, 13, 30

GamePadState class, 346

gameplay, third-person shooter game, designing, 337338

Gamer Services component, starting, 127131

GamerJoinedEventHandler method, 168

games

See also 3-D games; multiplayer games; screens for game; specific games

axis for 3-D, drawing

basic effect, coding, 216217

main program calls, coding, 217220

overview of, 210211

vertices and vertex buffer, coding, 211215

designing

Rock Rain, 39

TPS, 337338

ecosystem of, 5

ending criteria for, 4

finalization of, 11

goals of, 4

initialization of, 911

objects in, 40

planning

components of, 35

genre, 2

target market, 12

team for development, 23

playability of, 4

polishing, 5

role playing, tiles and, 16

saving, 5

storyline for, 4

structure of, 79

Games for Windows LIVE opening screen, 128

GameScreen class

attributes of, 384

constructor of, 385

description of, 351

Draw method, 391

drawing scene, 391392

initializing game objects, 385

loading game assets, 385386

Update method, 386387

UpdateInput method, 387390

UpdateWeaponnTarget method, 387

UpdateWeaponTarget method, 390391

GameSettings struct, SettingsManager class, 348

GameTime class, properties of, 12

GenerateTerrainIndices method (Terrain class), 268269

GenerateTerrainMesh method (Terrain class), 265267

GenerateTerrainNormals method (Terrain class), 272273

GenerateTerrainTangentBinormal method (Terrain class), 273275

GenerateTerrainVertices method (Terrain class), 269272

generating

height maps, 264

terrains

loading height map, 264266

mesh for, 266267

mesh indices for, 268269

mesh vertices for, 269272

normal vector of vertices and, 272273

tangent and binormal vectors of vertices and, 273275

genre, defining, 2

geometry and 2-D coordinate systems, 17

GetBound() method (GameComponent class), 48

GetHeight method, 293294

GetKeyboardDictionary method (SettingsManager class), 349

GetLeftThumbStick method (InputHelper class), 347

GetModelVertices method (AnimatedModelProcessor class), 358

GetRightThumbStick method (InputHelper class), 347

GetState method

GamePad object, 3031

KeyBoard object, 31

Mouse object, 31

GetTextureMaterial method, 382

goal

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

H

Haines, Eric, Real-Time Rendering, 289

Halo, 124

HandleActionInput method (Game1 class), 170172

HandleActionInput() method, 113

HandleClientData method (ActionScene class), 175177

HandleDamages method (ActionScene class), 196

HandleDamages() method, 107

HandleInput method (Player class), 190

HandleNetworkSceneInput method, 160161

HandleNotSigned method, 162

HandlePowerSourceSprite() method, 107108

HandleScenesInput method (Game1 class), 154

HandleScenesInput() method, 111

HandleServerData method (ActionScene class), 175181

HandleSigned method, 162

HandleStartSceneInput method (Game1 class), 153, 194

HandleStartSceneInput() method, 112

hardcore players, 2

heavy gamers, 2

height maps

building terrains from, 261263

for terrains, loading, 264266

generating, 264

help screen for game, adding, 6669

Helper classes

effect, 237238

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

RandomHelper, 350351

SettingsManager

GameSettings struct, 348

GetKeyboardDictionary method, 349

KeyboardSettings struct, 347348

Read method, 349

Save method, 349

Helpers namespace, 338

HelpScene class, modifying for Zune version, 186187

hiding latency from players of multiplayer games, 123124

hierarchy, skeleton, 309

High Level Shading Language (HLSL)

data types, 230231

functions, 233

input data, 231

intrinsic functions, 233234

overview of, 230

semantics, 231233

simple shader, creating, 234235

HookSessionEvents method, 167

host, multiplayer, creating, 126

I

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

initialization of game, 911

Initialize method, 11

input data (HLSL), 231

input from user

keyboard, 31

mouse, 31

overview of, 29

Xbox 360 gamepad, 3031

input to scene, controlling in Rock Rain Live, 161163

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

Terrain class, 296297

intrinsic functions (HLSL), 233234

IsFixedTimeStep property (Game class), 12

IsKeyJustPressed method (InputHelper class), 345

IsKeyPressed method (InputHelper class), 345

IsRunningSlowly property (GameTime class), 13

J

joining multiplayer session

asynchronously, 141143

synchronously, 139141

JoinSession method, 163

Jump method (TerrainUnit class), 354

K

keyboard, user input from, 31

KeyboardSettings struct (SettingsManager class), 347348

keyframe animation, 300301

Keyframe class, skeletal animation and, 307308

L

lag, 249

lastRayPosition variable, 295

latency, hiding from players of multiplayer games, 123124

Leal de Farias, José, web site of, 396

learning XNA, steps for, 397398

Left shoulder bone animation, 323

left-handed coordinate systems, 199

Lerp method (Vector3 class), 249

level designers, 3

LevelCreator class, 379384

LightManager class, 256257, 286

LightMaterial class, creating, 238

lightPosition parameter, 237

lights

3-D games, 209210

BaseLight class, 253

management of, 256257

PointLight class, 253254

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)

ActionScene class, 103110

clsSprite class, 18

GameComponent object

help scene, 6869

meteor, 8588

MeteorsManager, 8892

scoreboard, 92

sprite, 8385

MeteorsManager class, 8892

PowerSource GameComponent, 9597

LIVE (Microsoft Xbox LIVE)

Community Games, 126

profile, creating, 127131

Load method

AnimatedModel class, 322323

SkyDome class, 342

Terrain class, 264, 265

TerrainUnit class, 353

LoadContent method

description of, 11, 21

PlayerWeapon class, 366

loading

animated model, 321323

model as new content into sample program, 221

terrain height map, 264266

Lobão, Alexandre, web site of, 396

local player, 151

LocalNetworkGamer class, SendData and ReceiveData methods of, 144147

Location field (New Project dialog box), 6

loop, main program logic running in, 7, 1113

M

Main function (Program class), 8

main program calls, coding for 3-D axis, 217220

management classes for groups of GameComponents, 92

mapping

3-D objects to 2-D screen, 200201

normal, 273, 276277, 289291

margin of screen, 58

marine model, 366

MaterialContent object, 335

materials, effects and, 238239

matrices

3-D games, 206209

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, 7378

mesh

3-D games, 220223

description of, 228

for terrain

generating, 266267

indices for, 268269

vertices for, 269272

mesh effect, converting, 335336

mesh vertex, transforming, 324325

Meteor class

adding network support for, 178181

AddNewMeteor method, 180

modifying for Zune version, 188190

PutinStartPosition method, 178

meteors, creating for Rock Rain, 4952

MeteorsManager class

code for, 8892

modifying for Zune version, 192

Start method, 179

Microsoft

Cross-Platform Audio Creation Tool (XACT), 3234

Developer Network (MSDN) site, Platformer Starter Kit example, 16

DirectX Software Development Kit, 221

Xbox LIVE

Community Games, 126

profile, creating, 127131

Microsoft.Xna.Framework.Game class

Game1 object, 8

Update and Draw methods, 12

Microsoft.Xna.Framework.GamerServices namespace, 126127. See also Gamer Services component

Microsoft.Xna.Framework.Net namespace, 126127

mobile devices

usability issues for games on, 184

Zune platform, 183

Model class, 221, 301

model formats supported, 301

ModelContent object, 305, 312

modelers, 3

ModelMesh class, 221

ModelProcessor class

ExtractAnimations method, 314316

ExtractSkeletonAndAnimations method, 313314

overriding Process method of, 312313

skeletal animation and, 311312

models, 3-D games, 220223

monsters, 338

mouse, user input from, 31

Move method (Enemy class), 377378

moving sprite on screen, 2425

multiplayer games

See also Rock Rain Live

difficulty coding, 117

Framework.Net and Framework.GamerServices namespaces, 126127

helper messages for keys in, 148

network topology for, 117120

NetworkHelper class

CreateSession method, 135

defining, 132133

SignInGamer method, 133134

Update method, 135

NetworkSession class

BeginFind and EndFind methods, 141143

Create method, 134139

Find method, 139141

sending and receiving messages, 144147

starting, 143144

starting Gamer Services component, 127131

technical tips for

code for network features, 122

define message types and sizes, 123

hide latency from players, 123124

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 game, 40, 5455

to Rock Rain Zune version, 185

musicians, 3

MySounds.xap file, 3437

N

namespaces

Framework.Net and Framework.GamerServices, 126127

GameBase, 338

GameLogic, 338, 379

Helpers, 338

navigating between scenes, 110114

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, 117120

network-enabled games. See multiplayer games

NetworkHelper class

CreateSession method, 135

defining, 132133

Rock Rain Live, 163166

SignInGamer method, 133134

Update method, 135

NetworkHelper object, declaring in ActionScene class, 172

NetworkSession class

BeginFind and EndFind methods, 141143

Create method, 134139, 167

Find method, 139141

NetworkSession.SimulatedLatency command, 124

NetworkSession.SimulatedPacketLoss command, 124

New Project dialog box, 6

New Wave Bank option (XACT), 32

NodeContent object, 304305, 312

nonplayable character (NPC), 338

normal mapping

extending terrain effect with

overview of, 289

pixel processing for, 290291

vertex processing for, 290

overview of, 273, 276277

NormalizeBaseVectors method (TerrainUnit class), 356357

notify.wav file, 33

NPC (nonplayable character), 338

NPD Group

best-selling genres, 2

market categories, 1

NVIDIA FX Composer, 240

O

object transformations, Transformation class, 258259

object-oriented bounding box, 357

objects in game, 40

online multiplayer games. See multiplayer games

opening screen

for games, adding

audiolibrary class, creating, 7173

menu component, creating, 7378

overview of, 70

StartScene class, attributes for, 7882

for Rock Rain Live, 153155

organizing Rock Rain Zune version, 184185

orienting camera, 243244

orthogonal projections, 201, 209

P

PacketReader class object, 170, 173

PacketWriter class object, 170172

parallax scrolling, 16

passes, effects and, 235

pausing

network games, 170

scenes, 62

PeekChar method, 173

peer-to-peer connection for multiplayer games, 117118

perspective projections, 200, 208

phongShading method, 282, 334

pixel processing

AnimatedModel class, 333334

description of, 228

for normal mapping, 290291

for terrain effect, 281284

pixel shaders

See also techniques

description of, 229

semantics, 232

planning

games

components of, 35

genre, 2

target market, 12

team for development, 23

multiplayer games, 122

Rock Rain Live, 151152

Rock Rain Zune version, 183184

Play method, 37

playability of game, 4

PlayCue method, 36

Player class

adding network support for, 176177

aiming objects, 369

AttachWeapon method, 369

attributes of, 367

modifying for Zune version, 190192

overview of, 366

for Rock Rain game, creating, 97102

SetAnimation method, 362

Update method, 371372

UpdateChasePosition method, 368369

UpdateWaistBone method, 370

Player GameComponent, code for, 97102

Player object, Rock Rain Live, 174

player status message, 175

player's GameComponent, creating for Rock Rain, 4249

PlayerAnimations enumeration, 361

players

See also multiplayer games

local and remote, 151

of Rock Rain Live, synchronizing, 175181

types of, 2

PlayerWeapon class

attributes of, 365

constructor of, 365

LoadContent method, 366

overview of, 364

Update method, 366

point list, vertices rendered as, 203

PointLight class, 253254

polishing game, 5

positioning camera, 243244

PowerSource class

adding network support for, 177178

modifying for Zune version, 187188

PowerSource GameComponent, code for, 9597

PreferredBackBufferWidth property, 23

primitives, and 3-D games, 201205

Process method

AnimatedModelProcessor class, 359

ModelProcessor class, overriding, 312313

processors, animated model

creating, 311312

extracting model's animation, 314316

extracting model's skeleton, 313314

overriding default Process method, 312313

Program class, Main function, 8

programmers, 3

programming concepts

finalization of game, 11

game loop, 1113

general structure of game, 79

initialization of game, 911

overview of, 57

project management, 3

project, creating, 40

projection matrix, creating, 209, 241

projections

orthogonal, 201, 209

perspective, 200, 208

properties of clsSprite class, 18

Properties window, 20

Psionic web site, 372

PutinStartPosition method (Meteor class), 178

PutinStartPosition() method (GameComponent class), 48

Q

querying terrain height, 291294

R

RandomHelper class, 350351

rasterization, shaders and, 229

ray and terrain collision, 294297

ray variable, 295

Read method (SettingsManager class), 349

reading custom user data (AnimatedModelProcessor class), 316319

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), 144147

registering experience, 5

releasing paused network game, 170

remote player, 151

renaming Game1 class, 9

rendering pipeline, 227228

rendering terrains

multitexturing, 275

normal mapping, 276277

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, 103110

animated sprites, creating, 8392

energy source, creating, 9597

overview of, 82

Player class, creating, 97102

scoreboard, creating, 9295

background, drawing, 4142

design of, 39

enhancing, 61

game logic, creating, 5254

help screen, adding, 6669

meteors, creating, 4952

modifying and deploying to Xbox 360, 5759

navigating between scenes, 110114

opening screen, adding

audiolibrary class, creating, 7173

menu component, creating, 7378

overview of, 70

StartScene class, attributes for, 7882

player's GameComponent, creating, 4249

project, creating, 40

scoreboard, adding, 55

screens, adding, 6166

sound, adding, 5455

vibration effect, adding, 5657

Rock Rain Live

adding support for, 152

communication protocol, 170175

controlling input to scene, 161163

NetworkHelper class, 163166

opening screen, changing, 153155

planning, 151152

scene, creating, 155160

sessions, creating, 166170

synchronizing players, 175181

role playing games (RPG), tiles and, 16

rotating

3-D scene, 219220

camera around target, 250251

waist bone of player model, 369

RumblePad() method, Rock Rain game, 57

Run method, 8

runtime, handling skeletal animation model at, 319320

S

safe area, 58

sampler type (HLSL), 230

Save method (SettingsManager class), 349

saving game, 5

scalar types (HLSL), 230

ScatterEnemies method, 383384

scene for Rock Rain Live, creating, 155160

scenes. See screens for game

Score GameComponent, code for, 9295

scoreboard, adding to Rock Rain, 55

screen coordinate systems, 2-D graphics and, 1617

screen resolution, and Zune platform, 184

screen, margin of, 58

screens for game

action screen

ActionScene class, creating, 103110

animated sprites, creating, 8392

energy source, creating, 9597

overview of, 82

Player class, creating, 97102

scoreboard, creating, 9295

adding, 6166

flow of, 62

help screen, 6669

navigating between, 110114

opening screen

audiolibrary class, creating, 7173

menu component, creating, 7378

overview of, 70

StartScene class, attributes for, 7882

script writers, 3

scrolling background, 16

selling game in Xbox LIVE Community Games area, 126

semantics (HLSL), 231233

SendData method (LocalNetworkGamer class), 144147

SendDataOptions.InOrder flag, 125

SendDataOptions.Reliable flag, 125

serialize, 304

Services property (Game object), 286

SessionEndedEventHandler method, 168

sessions, creating for Rock Rain Live, 166170

sessions, multiplayer

creating, 134139

finding and joining

asynchronously, 141143

synchronously, 139141

sending and receiving messages, 144147

states of, 143144

SessionState property, 143144

SetAnimation method, 362

SetChaseParameters method (ThirdPersonCamera class), 248

SetEffectMaterial method (SkyDome class), 342343

SetEffectMaterial method (Terrain class), 286288

SetLookAt method (BaseCamera class), 243244

SetPerspectiveFov method (BaseCamera class), 241243

SettingsManager class

GameSettings struct, 348

GetKeyboardDictionary method, 349

KeyboardSettings struct, 347348

Read method, 349

Save method, 349

SetVibration method

GamePad class, 3031

Rock Rain game, 5657

shaders

authoring tools for, 240

description of, 228

effects and, 236

High Level Shading Language

creating, 234235

data types, 230231

functions, 233

input data, 231

intrinsic functions, 233234

semantics, 231233

passes and, 236

pixel, 229, 232

rasterization and, 229

rendering pipeline and, 228

vertex, 228, 231, 280281

Sharp Games community sites, 396

Show method (StartScene class), 192

ShowScene() method, 114

SignInGamer method (NetworkHelper class), 133134

single-player features, including in multiplayer games, 124

skeletal animations

AnimatedModel class

creating, 319320

loading, 321323

AnimatedModel class effect

application to vertex shader structure, 330

pixel processing, 333334

uniform variables, defining, 329330

vertex processing, 331333

vertex shader to pixel shader structure, 331

combining bone transformations, 325326

Content Pipeline and

animated model processor, 311316

AnimatedModelData class, creating, 309311

animation data classes, creating, 306307

AnimationData class, creating, 308309

Keyframe class, creating, 307308

overview of, 304306

reading and writing custom user data, 316319

converting mesh effect, 335336

drawing model, 336

equations for, 323324

extracting model's animation, 316

overview of, 301

transforming mesh vertex, 324325

Update method (AnimatedModel class), 326329

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

Draw method, 342343

Load method, 342

SetEffectMaterial method, 342343

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, 3234

using audio in games, 3537

sound effects

Rock Rain game, 40, 5455

Rock Rain Zune version, 185

SoundBank object, 36

spider model, 372

spinning 3-D axis, 219220

sprite

animating, 8392

collision detection for, 2629

definition of, 15

drawing

on screen, 2023

Sprite class, creating, 18

sprite image, adding, 1920

window size, changing, 23

moving on screen, 2425

SpriteBatch class

Begin method, 22

description of, 20

Draw method, 22

rendering pipeline and, 228

TPS game and, 391392

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

multiplayer games, 143144

XACT, 32, 34

STARTMETEORCOUNT constant, 52

StartScene class

attributes for, 7882

modifying for Zune version, 192193

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

structure of game, 79

support for network games, adding, 152

synchronizing

game state in multiplayer game, 151

players of Rock Rain Live, 175181

SystemLink, 167

T

tangent base, 273

target, rotating camera around, 250251

target market, 12

team for game development, members of, 23

technical design of third-person shooter game, 338

technique for terrain effect, defining, 284

techniques, effects and, 235

terminology of 2-D graphics, 1516

Terragen procedural generation tool, 264

Terrain class

attributes, 264

GenerateTerrainIndices method, 268269

GenerateTerrainMesh method, 265267

GenerateTerrainNormals method, 272273

GenerateTerrainTangentBinormal method, 273275

GenerateTerrainVertices method, 269272

heightScale attribute, 270

Intersects method, 296297

Load method, 264, 265

SetEffectMaterial method, 286288

for TPS game, 339

terrain effect

creating, 277280

effect material, setting, 284288

extending with normal mapping

overview of, 289

pixel processing for, 290291

vertex processing for, 290

pixel processing for, 281284

technique for, defining, 284

vertex input and output structures for, 280

vertex shader for, 280281

terrain grid

block in, 292

object position relative to, 291

TerrainEffect class, 284286

TerrainMaterial class, 265, 284288

terrains

See also terrain effect

building from height maps, 261263

collision test methods, 294297

drawing, 288291

generating

loading height map, 264266

mesh for, 266267

mesh indices for, 268269

mesh vertices for, 269272

normal vector of vertices and, 272273

tangent and binormal vectors of vertices and, 273275

overview of, 261

querying height, 291294

rendering

multitexturing, 275

normal mapping, 276277

TerrainUnit class

animations, changing, 361363

collision tests, 359361

collision volume, 357359

constructor of, 353

Draw method, 363

Jump method, 354

Load method, 353

overview of, 351353

ReceiveDamage method, 361

SetAnimation method, 362

Update and NormalizeBaseVectors methods, 356357

UpdateHeight method, 354356

testers, 3

testing

for collisions, 2629

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

designing, 337338

Enemy class

AttackPlayer method, 378

attributes of, 373

ChasePlayer method, 378

Move method, 377378

overview of, 372

Update method, 373375

Wander method, 376377

Wandering state, 375376

examples of, 337

game engine, starting

animated model processor, 339340

cameras, lights, and transformations, 339

overview of, 338

sky, 340

SkyBox, 340

SkyDome, 340

Terrain class, 339

GameLogic classes

GameScreen, 351

LevelCreator, 379384

TerrainUnit, 351363

GameLogic namespace, GameLevel struct, 379

GameScreen class

attributes of, 384

constructor of, 385

Draw method, 391

drawing scene, 391392

initializing game objects, 385

loading game assets, 385386

Update method, 386387

UpdateInput method, 387390

UpdateWeaponTarget method, 387391

Helper classes

InputHelper, 343347

RandomHelper, 350351

SettingsManager, 347349

Player class

aiming objects, 369

AttachWeapon method, 369

attributes of, 367

overview of, 366

Update method, 371372

UpdateChasePosition method, 368369

UpdateWaistBone method, 370

PlayerWeapon class

attributes of, 365

constructor of, 365

LoadContent method, 366

overview of, 364

Update method, 366

SkyDome class

creating, 340

Draw method, 342343

Load method, 342

SetEffectMaterial method, 342343

Update method, 342

TPSGame class, 392393

UnitTypes class, 363364

ThirdPersonCamera class

overview of, 247

rotating camera around target, 250251

SetChaseParameters method, 248

Update method, 252

UpdateFollowPosition method, 248250

threads, dedicating to network messages in multiplayer games, 125

3-D games

coordinate systems, 199201

creating to learn XNA, 397

drawing axis for

basic effect, coding, 216217

main program calls, coding, 217220

overview of, 210211

vertices and vertex buffer, coding, 211215

lights, cameras, and effects, 209210

models and meshes, 220223

vectors and matrices, 205209

vertices and primitives, 201205

thumbstick

aim mode and, 387

GamePadState class and, 346347

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

TPSGame class, 392393

Transformation class, 258259, 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

coordinate systems, 1617

terminology for, 1516

TwoPlayers attribute (ActionScene class), 195

U

Unicode, 123

uniform input data, 231

unit collision tests, TerrainUnit class, 359361

unit collision volume, TerrainUnit class, 357359

UnitTypes class, 363364

UnloadContent method, 11, 22

Update method

AnimatedModel class, 326329

DrawableGameComponent class, 4448

Enemy class, 373375

Game class, 48

Game1 class, 24

GameScreen class, 386387

InputHelper class, 344

Microsoft.Xna.Framework.Game class, 12

NetworkHelper class, 135

Player class, 191, 371372

PlayerWeapon class, 366

predefined code for ending game, 13

SkyDome class, 342

StartScene class, 192

TerrainUnit class, 356357

ThirdPersonCamera class, 252

UpdateChasePosition method (Player class), 368369

UpdateCollision method (BoundingSphere class), 360

UpdateFollowPosition method (ThirdPersonCamera class), 248250

UpdateFrustum method (BoundingFrustum class), 246

UpdateHeight method (TerrainUnit class), 354356

UpdateInput method (GameScreen class), 387390

UpdateMenus method, 159

UpdateNetworkData method, 176

UpdateView method (BaseCamera class), 251

UpdateWaistBone method (Player class), 370

UpdateWeaponTarget method (GameScreen class), 390391

usability issues, and games for mobile devices, 184

user input

keyboard, 31

mouse, 31

overview of, 29

Xbox 360 gamepad, 3031

using statement, creating object in, 8

V

varying input data, 231

Vector2 class, 18

Vector3 class

Cross method, 243, 245

Lerp method, 249

Vector3 data type

methods of, 205

shortcuts of, 206

vertices and, 201

vectors

3-D games, 205206

camera coordinate system, 244246

velocity property (clsSprite class), 2425

vertex buffer, coding for 3-D axis, 211215

vertex grid, 6×6, created over x,z plane, 261

vertex processing

AnimatedModel class, 331333

for normal mapping, 290

vertex shaders

See also techniques

description of, 228

semantics, 231

for terrain effect, 280281

vertex structures, predefined, 266

VertexBuffer for terrain mesh, 267

VertexPositionNormalTangentBinormalTexture, defining, 266267

vertices

3-D games, 201205

coding for 3-D axis, 211215

mesh, 266, 324325

moving triangle up Y axis and, 206

normalizing weights of, 325

representing as matrices, 207

terrains

generating position and texture coordinate, 269272

normal vector, 272273

tangent and binormal vectors, 273275

vibration effect, adding to Rock Rain, 5657

view matrix, 209, 243244

viewport, aspect ratio and, 209

Visual C# Express Edition, downloading, 5

W

walking character, animating, 299

Wander method (Enemy class), 376377

Wandering state (Enemy class), 375376

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

recommended, 396397

Sharp Games community sites, 396

SpriteLIB GPL, 43

Xbox LIVE Community Games, 126

XNA Creators Club, 5, 397

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), 316318

X

X (DirectX File) format, 301

XACT (Microsoft Cross-Platform Audio Creation Tool), 3234

Xbox 360

gamepad, user input from, 3031

modifying and deploying Rock Rain to, 5759

skeletal animation and, 307

Xbox LIVE (Microsoft)

Community Games, 126

profile, creating, 127131

XNA 3.0 Game Programming Recipes (Grootjans), 396

XNA Creators Club

Billboards sample, 16

web site, 5, 397

XNA Game Studio, downloading, 5

XNA Game Studio Device Center with Zune added, 196

Z

Zune platform

deploying game on, 196198

menu changes for Rock Rain version for, 187

modifying classes for Rock Rain version for

ActionScene class, 195196

Game1 class, 193195

HelpScene class, 186187

Meteor class, 188190

MeteorsManager class, 192

Player class, 190192

PowerSource class, 187188

StartScene class, 192193

organizing Rock Rain version for, 184185

planning Rock Rain version for, 183184

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.25.41