Tải bản đầy đủ (.pdf) (508 trang)

Learning XNA 3 0

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (5.76 MB, 508 trang )

Learning XNA 3.0
Other resources from O’Reilly
Related titles
C# 3.0 in a Nutshell
Coding4Fun
Essential Silverlight 2
Up-to-Date
Learning ASP.NET 2.0 with
AJAX
Learning C# 3.0
Physics for Game Developers
oreilly.com
oreilly.com is more than a complete catalog of O’Reilly books.
You’ll also find links to news, events, articles, weblogs, sample
chapters, and code examples.
oreillynet.com is the essential portal for developers interested in
open and emerging technologies, including new platforms, pro-
gramming languages, and operating systems.
Conferences
O’Reilly brings diverse innovators together to nurture the ideas
that spark revolutionary industries. We specialize in document-
ing the latest tools and systems, translating the innovator’s
knowledge into useful skills for those in the trenches. Visit
conferences.oreilly.com for our upcoming events.
Safari Bookshelf (safari.oreilly.com) is the premier online refer-
ence library for programmers and IT professionals. Conduct
searches across more than 1,000 books. Subscribers can zero in
on answers to time-critical questions in a matter of seconds.
Read the books on your Bookshelf from cover to cover or sim-


ply flip to the page you need. Try it today for free.
Learning XNA 3.0
Aaron Reed
Beijing

Cambridge

Farnham

Köln

Sebastopol

Taipei

Tokyo
Learning XNA 3.0
by Aaron Reed
Copyright © 2009 Aaron Reed. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (safari.oreilly.com). For more information, contact our
corporate/institutional sales department: (800) 998-9938 or
Editors:
John Osborn and Laurel Ruma
Production Editor:
Sumita Mukherji
Copyeditor:
Rachel Head

Proofreader:
Sumita Mukherji
Indexer:
John Bickelhaupt
Cover Designer:
Karen Montgomery
Interior Designer:
David Futato
Illustrator:
Robert Romano
Printing History:
November 2008: First Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. Learning XNA 3.0, the image of a sea robin fish, and related trade dress are
trademarks of O’Reilly Media, Inc.
.NET is a registered trademark of Microsoft Corporation.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume
no responsibility for errors or omissions, or for damages resulting from the use of the information
contained herein.
This book uses RepKover

, a durable and flexible lay-flat binding.
ISBN: 978-0-596-52195-0
[M]
This book is dedicated to the most beautiful
woman on earth (yeah, sorry guys that would
be my wife, Stacy) and our children (Hayden,

Bryson, Rylan, and Kaylee).
vii
Table of Contents
Preface
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xiii
1. Getting Started
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
System Requirements 1
Additional Resources 2
Installation 2
Creating Your First XNA Application 4
What You Just Did 5
Summary 6
Test Your Knowledge: Quiz 7
2. Fun with Sprites
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8
A Look Behind the Scenes 8
Game Development Versus Polling 11
Modifying Your Game 14
Adding a Sprite to Your Project 15
Loading and Drawing Your Sprite 18
Transparency and Other Options 21
Layer Depth 25
Let’s Move 28
Animation 30
Adjusting the Framerate 35

Adjusting the Animation Speed 36
What You Just Did 38
Summary 38
viii | Table of Contents
Test Your Knowledge: Quiz 39
Test Your Knowledge: Exercise 39
3. User Input and Collision Detection
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40
More Sprites 40
Keyboard Input 43
Mouse Input 45
Gamepad Input 47
Keeping the Sprite in the Game Window 50
Collision Detection 50
What You Just Did 55
Summary 56
Test Your Knowledge: Quiz 56
Test Your Knowledge: Exercise 57
4. Applying Some Object-Oriented Design
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
58
Designing Your Classes 58
Creating a Sprite Class 59
Creating a User-Controlled Sprite Class 63
Creating an Automated Sprite 65
Game Components 67
Coding the SpriteManager 69
Cleaning Up 71
Making Them Move 74

What You Just Did 74
Summary 74
Test Your Knowledge: Quiz 75
Test Your Knowledge: Exercise 75
5. Sound Effects and Audio
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
76
Using XACT 77
Implementing XACT Audio Files in Code 83
Using the Simplified API for Sound and Audio 85
Adding More Sound to Your Game 86
What You Just Did 91
Summary 91
Test Your Knowledge: Quiz 91
Test Your Knowledge: Exercise 91
Table of Contents | ix
6. Basic Artificial Intelligence
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
92
The Turing Test 93
Creating Sprites at Random Intervals 93
Randomly Spawning Sprites 95
Irrelevant Objects 99
Creating a Chasing Sprite 101
Creating an Evading Sprite 107
What You Just Did 112
Summary 113
Test Your Knowledge: Quiz 113
Test Your Knowledge: Exercise 113
7. Putting It All Together

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
114
Drawing 2D Text 115
Randomly Generating Different Sprite Types 121
Adding Some Variety to Your Sprites 123
Adding a Background Image 128
Game Scoring 130
Game States 137
Enabling/Disabling GameComponents 141
Game-Over Logic and the Game-Over Screen 143
Fine-Tuning Gameplay 150
Creating Power-Ups 154
What You Just Did 159
Summary 159
Test Your Knowledge: Quiz 160
Test Your Knowledge: Exercise 160
8. Deploying to the Microsoft Zune
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
161
Setting Up Your Zune Device Connection 161
Creating a Zune Project 163
Input on the Zune 165
Audio on the Zune 167
Resolution and Gameplay Issues 169
Converting the Collision Game from Windows to Zune 170
Conditional Compilation Symbols 171
Converting the Collision Game Audio 173
Converting the Collision Game’s Player Input Code 175
Converting the Collision Game’s Screen Size 178
x | Table of Contents

Zune Performance 179
What You Just Did 180
Summary 181
Test Your Knowledge: Quiz 181
9. 3D Game Development
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
182
Coordinate Systems 182
Cameras 184
Creating a 3D Camera 186
Drawing Primitives 189
Matrix Multiplication 194
Movement and Rotation 194
Backface Culling 197
More on Rotations 198
Even More Rotations 200
Primitive Types 202
Applying Textures 204
What You Just Did 209
Summary 209
Test Your Knowledge: Quiz 210
Test Your Knowledge: Exercise 211
10. 3D Models
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
212
Using 3D Models 212
Setting Up the Project 213
Adding a Model to Your Project 216
Drawing a Model Using a BasicModel Class 217
Adding a Model Manager 221

Rotating Your Model 224
What You Just Did 226
Summary 226
Test Your Knowledge: Quiz 226
Test Your Knowledge: Exercise 227
11. Creating a First-Person Camera
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
228
Components of a Moving 3D Camera 228
Moving in a First-Person Camera 232
Rotations in a First-Person Camera 235
Coding the Camera for the 3D Game 240
Table of Contents | xi
What You Just Did 244
Summary 244
Test Your Knowledge: Quiz 245
Test Your Knowledge: Exercise 245
12. 3D Collision Detection and Shooting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
246
Creating a Moving Enemy 246
Adding Some Game Logic 248
Firing Shots 257
3D Collision Detection and Bounding Spheres 261
Adding a Crosshair 265
Adding Sound 266
What You Just Did 273
Summary 273
Test Your Knowledge: Quiz 274
Test Your Knowledge: Exercise 274

13. HLSL Basics
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
275
HLSL Syntax 277
Dissecting a Sample HLSL Effect File 278
Applying an HLSL Effect in C# 287
Applying HLSL Using Textures 295
HLSL Effects: Creating a Negative 303
HLSL Effects: Blur 304
HLSL Effects: Grayscale 304
What You Just Did 306
Summary 307
Test Your Knowledge: Quiz 307
Test Your Knowledge: Exercise 307
14. Particle Systems
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
308
Creating a Custom Vertex 308
Creating a Particle Engine 312
Adding a Particle Effect File 320
Adding Your Particle Engine to Your Game 322
Adding a Starfield 325
What You Just Did 330
Summary 331
Test Your Knowledge: Quiz 331
xii | Table of Contents
15. Wrapping Up Your 3D Game
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
332
Adding a Splash Screen Game Component 332

Keeping Score 342
Adding a Power-Up 347
What You Just Did 352
Test Your Knowledge: Exercise 353
16. Deploying to the Xbox 360
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
354
Adding an Xbox 360 Device 354
Converting a Project to Run on the Xbox 360 358
Supporting Gamepad Input 361
Deploying to the Xbox 360 367
Xbox 360 Display Settings 369
The Title Safe Region 370
What You Just Did 372
Summary 372
Test Your Knowledge: Quiz 373
17. Multiplayer Games
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
374
Split-Screen Functionality 374
Network Game Development 384
Network Configurations 385
Writing an XNA Network Game 387
Modifying the Sprite Class 388
Modifying the UserControlledSprite Class 388
Coding Your Game1 Class 391
Adding Update Code 394
Adding Draw Code 410
Adding Biohazard Bombs of Insanity! 415
What You Just Did 422

Summary 423
Test Your Knowledge: Quiz 424
Appendix: Answers to Quizzes and Exercises
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
425
Index
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
477
xiii
Preface1
I’ve taught DirectX and XNA game development courses at Neumont University for
the past several years, and I’ve been repeatedly frustrated by my inability to find the
right book for these classes. There are numerous books on the subject, but none that
I felt fit the goals of my classes (introductory college-level game development courses
targeted to an audience that is familiar with C#), or that presented the material in a
style and sequence I felt was appropriate.
Many books required too much previous game or graphics development knowledge.
Others assumed too little knowledge of nongame-related development concepts. Still
others relied too much on third-party libraries, or presented the material in a sequence
that would be counterintuitive to a reader who is new to game development.
I found myself jumping around from Chapter 3 in one book to Chapter 18 in
another, then back to the original book for Chapters 8 and 2, and so forth, while fill-
ing in gaps with slides, code samples, and documents I created on my own.
Eventually, I decided to take the content I had developed for my XNA game develop-
ment course and write some material on the subject for use in the classroom. Initially, I
was going to simply create some papers and essays to give to the students. I then real-
ized that a large audience outside of the university would probably benefit from the
material as well. I contacted O’Reilly about the book, and the rest is history.
Through my experience teaching XNA game development, I have been able to deter-
mine which points typically snag students and which points are typically easily

grasped. I’ve also developed what I feel is a pretty straightforward way of presenting
the material in a sequence that makes sense and is easy to follow. This book is
designed to follow that sequence and to introduce concepts in a way that will help
readers to fully understand each individual topic.
xiv
|
Preface
Who This Book Is For
This book is meant to be a solid introduction to game development for somebody
with basic knowledge of the .NET Framework and C# (or similar technologies). No
previous XNA or other game or graphics development experience or knowledge is
required.
How This Book Is Organized
This book introduces XNA game development concepts while walking the reader
through the development of three different XNA games. Although most of the mate-
rial generally applies to developing games for any of the available platforms, Chap-
ters 8 and 16 focus on developing games for the Zune and the Xbox 360,
respectively.
The first portion of the book takes the reader through the development of a 2D
game. Here are the chapters that compose this section:
Chapter 1, Getting Started
Walks you through a short introduction to XNA, the tools needed to develop
games in XNA, and the installation of XNA Game Studio 3.0.
Chapter 2, Fun with Sprites
Introduces 2D sprites, transparency, sort order, movement, framerates, sprite
sheets, and animation.
Chapter 3, User Input and Collision Detection
Covers user input from keyboards, mice, and Xbox 360 gamepads, as well as the
implementation of collision detection.
Chapter 4, Applying Some Object-Oriented Design

Discusses and implements game components and applies an object-oriented
class hierarchy to the design of your game.
Chapter 5, Sound Effects and Audio
Introduces the Microsoft Cross-Platform Audio Creation Tool (XACT), as well
as the new simplified audio API as methods to add sound to your games on the
PC, Xbox 360, and Zune.
Chapter 6, Basic Artificial Intelligence
Explains the nature of the science of artificial intelligence and introduces basic
artificial intelligence concepts; also walks through creating customized derived
classes within your class hierarchy to implement different behaviors for your
sprites.
Chapter 7, Putting It All Together
Puts the finishing touches on the 2D game, including 2D text, scoring, adding
different types of sprites, background images, game states, and power-ups.
Preface
|
xv
Chapter 8, Deploying to the Microsoft Zune
Takes the 2D game created in the previous chapters and converts it for deploy-
ment to the Zune. Most code is Zune-ready, but changes to audio and user input
as well as changes to handle the smaller screen size of a Zune are made; the game
is then deployed to the Zune.
The next section of the book walks the reader through the development of a 3D
game for the PC. At the end of this section, the game is tweaked and deployed to the
Xbox 360. Here are the chapters in this section:
Chapter 9, 3D Game Development
Discusses coordinate systems, cameras, and drawing primitive objects, as well as
moving, rotating, and scaling objects in 3D space. Culling and texturing sur-
faces are also discussed.
Chapter 10, 3D Models

Introduces 3D models and discusses drawing, rotating, and moving 3D models
in 3D space.
Chapter 11, Creating a First-Person Camera
Walks the reader through the creation of a first-person vector-based camera in
3D; implements forward and backward movement, strafing, and rotation in yaw,
pitch, and roll.
Chapter 12, 3D Collision Detection and Shooting
Delves into the code behind shooting a moving enemy, creating a shot object,
moving it in 3D space, and handling collision detection in 3D using bounding
spheres; a 3D crosshair HUD and audio effects are also added to the game.
Chapter 13, HLSL Basics
Introduces High Level Shader Language (HLSL) syntax and implementation as
well as the code required to use HLSL effects in XNA; a number of image manip-
ulation effects are implemented using HLSL.
Chapter 14, Particle Systems
Walks the reader through the implementation of a custom vertex and a particle
used to create an explosion particle effect.
Chapter 15, Wrapping Up Your 3D Game
Fine-tunes the 3D game, with sections covering splash screens, game states, scor-
ing, and power-ups.
Chapter 16, Deploying to the Xbox 360
Walks the reader through connecting an Xbox 360 to a PC and deploying to the
Xbox 360; user input and screen resolution differences between the PC and the
Xbox 360 are discussed.
The last section of the book walks you through creating a network game in XNA.
This section assumes knowledge of all previous chapters and comprises only one
xvi
|
Preface
chapter, which concentrates on networking functionality in XNA while stepping

through the creation of a new XNA game:
Chapter 17, Multiplayer Games
Introduces multiplayer concepts through split-screen functionality as well as net-
working; topics include network architectures, network states, communication
via packets, and gamer services.
Finally, in the appendix, you’ll find the answers to the quizzes at the end of each
chapter.
Support
My goal in writing this book is to help the reader gain a true understanding of and
passion for game development in XNA. To that end, I’ll be supporting the book
through my blog, which can be found at:
/>On that website you’ll find the source code for the book, as well as other XNA-
related content (and a fair bit of non-XNA-related content as well). Feel free to chime
in on the forums with questions, comments, or even answers.
Conventions Used in This Book
The following typographic conventions are used in this book:
Italic
Used for emphasis, technical terms where they are defined, URLs, email
addresses, filenames, file extensions, and pathnames
Constant width
Used for code samples, methods, functions, variables and their values, objects,
and class names
Constant width bold
Used for emphasis in code samples
This icon signifies a tip, suggestion, or general note.
This icon indicates a warning or caution.
Preface
|
xvii
Using Code Examples

This book is here to help you get your job done. In general, you may use the code in
this book in your programs and documentation. You do not need to contact us for
permission unless you’re reproducing a significant portion of the code. For example,
writing a program that uses several chunks of code from this book does not require
permission. Selling or distributing a CD-ROM of examples from this book does
require permission. Answering a question by citing this book and quoting example
code does not require permission. Incorporating a significant amount of example
code from this book into your product’s documentation does require permission.
We appreciate, but do not require, attribution. An attribution usually includes the
title, author, publisher, and ISBN. For example: “Learning XNA 3.0, by Aaron Reed.
Copyright 2009 Aaron Reed, 978-0-596-52195-0.”
If you feel your use of code examples falls outside fair use or the permission given
above, feel free to contact us at
We’d Like to Hear from You
We have tested and verified the information in this book to the best of our ability,
but you may find that features have changed or that we may have made a mistake or
two (shocking and hard to believe as that may be). Please let us know about any
errors you find, as well as your suggestions for future editions, by writing to:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)
We have a web page for this book, where we list examples and any plans for future
editions. You can access this information at:
/>You can also send messages electronically. To be put on the mailing list or request a
catalog, send an email to:

To comment on the book, send an email to:


For more information about our books, conferences, Resource Centers, and the
O’Reilly Network, see our website at:

xviii
|
Preface
Safari® Books Online
When you see a Safari® Books Online icon on the cover of your
favorite technology book, that means the book is available online
through the O’Reilly Network Safari Bookshelf.
Safari offers a solution that’s better than e-books. It’s a virtual library that lets you
easily search thousands of top tech books, cut and paste code samples, download
chapters, and find quick answers when you need the most accurate, current informa-
tion. Try it for free at .
Acknowledgments
After writing this book, I sat back and reflected on the process I’ve been through dur-
ing the past six months. The first question that came to my mind was, “What on
earth drove me to sit down and write something like this in the first place?” The first
part of the answer to that question would be my mom, Sheree. No, my mother wasn’t
asking me to write a book; instead, her influence in this area came long before that.
When I was pretty young, my brother and I became hooked on the original King’s
Quest game. Mom came to our rescue countless times, because even though we had
twenty fingers between the two of us, we were too young to type the word “swim”
before Sir Graham would drown in the waters around the Kingdom of Daventry. The
King’s Quest series instilled in me a love for gaming and computers in general that has
dramatically shaped the direction of my life ever since. Thanks for keeping me afloat,
Mom.
The other part of the answer lies with the hundreds of students who’ve taken my
DirectX and XNA graphics courses at Neumont University. From Brett Beardall’s

purposefully annoying, “Aaaaarrrrroooonnnn, I have a quessssttttiioooonn” voice to
Ryan Abreus’ unhealthy obsession with unicorns (yeah, don’t ask), you all are the
reason I have developed such enthusiasm for XNA. Thank you!
Beyond simply writing the book, my next question was, “How was it possible for
me, somebody whose lengthiest writing was a four-page essay on economics in col-
lege, to write something this large in scale?” The answer to that question is easy. I
had a lot of help. Let’s face it, this book would have been pretty boring and lame and
cluttered with incorrect and poorly written code if I had done all of this myself.
Luckily, I had a ton of assistance from people far smarter than myself.
Laurel Ruma from O’Reilly was there the entire way, helping me with all of my ques-
tions and walking me through this process. Marlowe Shaeffer was a huge boost from
the beginning, getting me started on the right path. Sumita Mukherji was a patient
and fantastic production editor.
Preface
|
xix
Andy Dunn, Brian Keller, and Chris Williams have been phenomenal through this
entire process. Each of them has been an extremely valuable resource in terms of
XNA as well as writing style and accuracy. This book is much better because of their
help. Stephanie Reiman on the XNA team at Microsoft was also very helpful.
Adrian Wolfgang Meyers created the images used in the 2D section of this book.
William Howard Brown and Joseph Irizarry were also very helpful in developing
some initial code for the networking chapter of the book.
You all rock! Thank you so much!
1
Chapter 1
CHAPTER 1
Getting Started1
Computers truly are amazing machines. Contemplating how a modern computer

starts with nothing but 1s and 0s and ends up with the tools we use on a daily basis
is both awe-inspiring and mind-boggling. Perhaps nothing does a better job of har-
nessing the power of the computer and the interest of the user than a good com-
puter game. From the early days of Pong to the latest titles of today, video games
have captured the imaginations of billions of people.
With Microsoft’s XNA game development framework, writing exciting games for the
PC has never been easier. On top of that, XNA 3.0 offers individual developers an
unprecedented opportunity: the ability to develop your own games for the Xbox 360
and the Microsoft Zune. Never before has access to software development kits target-
ing next-gen consoles or the latest handheld media devices been so readily available.
I’m sure you’re ready to get started and begin building the next great game, so let’s
get right to it. This first chapter will help you get everything installed so you can dive
in and start developing in XNA 3.0.
System Requirements
This book uses XNA Game Studio 3.0, which is an integrated development environ-
ment (IDE) extension to Microsoft’s Visual Studio for developing games in XNA.
XNA Game Studio 3.0 uses the XNA Framework 3.0, which provides developers
with a skeleton XNA game to begin with and the ability to customize and extend that
game in order to create their own games in XNA.
XNA Game Studio 3.0 runs on multiple versions of Microsoft Visual Studio 2008. To
install it, you must first install either Visual Studio 2008 Standard Edition or higher
(with C# language support installed), or Visual C# 2008 Express Edition.
Visual C# 2008 Express Edition is available at no cost from Microsoft at http://www.
microsoft.com/express/vcsharp/. It’s a great way to get started in XNA if you don’t
have a license for one of the other versions.
2
|
Chapter 1: Getting Started
Throughout this book, I’ll be using Visual Studio 2008 Professional Edition. The
screenshots should look the same (or at least similar) across versions, but you should

be aware of the version used to create these examples in case there are discrepancies.
With XNA 3.0, developers can target the following platforms for their games: Win-
dows Vista, Windows XP, Xbox 360, and Microsoft Zune. To run XNA games on
Windows, you’ll need a graphics card that supports Shader Model 1.1 or higher and
DirectX 9.0c. However, some examples may require Shader Model 2.0.
XNA Game Studio 3.0 is available for download at no charge through Microsoft’s
website at />474c-bfd0-7cf8ed3036a3&displaylang=en&tm.
Additional Resources
In addition to this book, you may want to check out the Microsoft Creator’s Club
Online website (). The Creator’s Club website is packed full of
tutorials, code samples, and other resources to get you started in XNA.
Also, if you’re a student, you may want to look at DreamSpark (https://downloads.
channel8.msdn.com). DreamSpark is a Microsoft initiative that allows students access
to professional versions of Visual Studio and other design and development tools at
no cost.
Installation
After you’ve installed one of the versions of Visual Studio 2008 mentioned previ-
ously, install XNA Game Studio 3.0. The setup for XNA Game Studio is fairly
straightforward, but I’ll walk you through it here. At the welcome screen
(Figure 1-1), click Next.
After reading through the EULA (End User License Agreement), accept the agree-
ment and select Next, as shown in Figure 1-2.
The next screen in the install (Figure 1-3) asks whether you want to allow Game Stu-
dio and XNA games to communicate through the firewall on your computer. It is
recommended that you allow these communications. The first option is required if
you want to be able to deploy XNA game projects to an Xbox 360; the second is
required for network play in XNA games. Enable both firewall communications and
select Next.
If you have other firewall software on your computer, you may need to
add rules for Xbox 360 communications and the XNA Framework

manually. See for
details.
Installation
|
3
Figure 1-1. Installation welcome screen
Figure 1-2. EULA

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×