Home Page Icon
Home Page
Table of Contents for
IV. Building Games for the PC, Xbox 360, and Zune
Close
IV. Building Games for the PC, Xbox 360, and Zune
by Jerry Lee Ford
XNA® 3.1 Game Development for Teens: Game Development on the PC, Xbox 360®, and Zune® Player
Copyright
Dedication
Acknowledgments
About the Author
Introduction
Why XNA 3.1?
Who Should Read This Book?
What You Need to Begin
Conventions Used in This Book
Companion Website Downloads
I. XNA Development Basics
1. Introducing Microsoft XNA Game Studio 3.1
The Computer Gaming Industry
Getting to Know Microsoft XNA Game Studio 3.1
XNA 3.1 Uncovered
The Visual Studio Express IDE
XNA Framework
DirectX
C#
The .NET Framework
Computer Game Development
Zune
Xbox 360
Getting Started with XNA 3.1
Downloading and Installing Microsoft Visual C# 2008 Express onto Your Computer
Installing Microsoft XNA Game Studio 3.1 onto Your Computer
Creating an Xbox Live Account
Connecting Your Xbox 360 and Zune to Your Computer
Connecting Your Xbox 360 to Your Internet Router
Setting Up a Connection with Your Computer
Connecting Your Zune to Your Computer
Joining the XNA Creators Club
Summary
2. Getting Started
Getting to Know the Visual Studio 2008 Express IDE
Navigating IDE Menus
Working with Toolbars
Getting to Know the Code Editor
Pre-written Program Code
Color Coding, Automatic Indentation, and Spacing
Taking Advantage of “IntelliSense Everywhere”
Introducing the Solution Explorer
Understanding the Properties Window
Working with the Error List Window
Summary
3. Creating Your First XNA Application
Classes, Objects, Methods, and Variables
Creating a Simple XNA Application
Creating a New Project
Executing Your New Application
Halting Application Execution
Examining Program Organization and Structure
Examining the Program.cs Program
Examining the Game1.cs Program
Using Directive Statements to Reference Namespaces
Defining a Local Namespace and Class
Defining with Data Members
Examining Method Members
Dissecting the Game1.cs Program
Summary
II. Learning How to Program with Visual C# Studio Express 2008
4. Working with Data, Values, and Variables
Introducing C#
C# Programs Are Compiled
C# Is an Object-Oriented Programming Language
Documenting Your Program Code
Working with Different Types of Values
Storing and Retrieving Game Data
Defining C# Variables
Naming Variables
Variable Scope
Storing Data That Does Not Change
Managing Collections of Data
Accessing Array Contents
Using a Loop to Process an Array
Creating Dense Arrays
Manipulating Data
Performing Calculations
Assigning Variable Values
Comparing Variable Values
C# Keywords
Summary
5. Conditional Logic and Loops
Creating an XNA Template Application
Analyzing Data and Making Decisions
Implementing Conditional Logic Using the if Statement
Using Multiline if Statements
Specifying Alternative Conditions
Evaluating Additional Conditions
Nesting Multiple if Statements
Implementing Conditional Logic Using the switch Statement
Processing Data Efficiently with Loops
Using the for Loop
Using the while Loop
Using the do Loop
Using the foreach Loop
Altering Normal Loop Execution
Summary
6. Objects, Classes, and Methods
A Deeper Look at the Inner Workings of XNA Applications
The System Name Space
Namespaces
The Program Class
Methods
Garbage Collection
Game Execution
Object-Oriented Programming
Important OOP Terms You Need to Know
Abstraction
Encapsulation
Inheritance
Polymorphism
Defining Your Own Classes and Objects
Creating a New Class
Understanding Data Members
Setting Up Class Properties
Instantiating Objects
Adding Methods to Classes
Overloading Methods
Inheriting from Another Class
Structures
Summary
III. Game Development Basics
7. Collecting User Input
Using Game Input
Collecting Player Input
Platform-Supported Controllers
Collecting Gamepad Input
Gamepad Buttons
Thumbstick Controls
The Dpad
Vibrating the Gamepad
Collecting and Processing Keyboard Input
Collecting Mouse Input
Interacting with Zune Users
Creating Multi-Platform Games
Creating the Control Testing Application
Adding a SpriteFont to Display Test Output
Defining Game World Data
Application Initialization
Keeping the Game Updated
Retrieving Input Device State Data
Managing Application Termination
Interacting with the Gamepad
Collecting and Reporting Mouse Data
Processing Keyboard Input
Displaying Output
Summary
8. Working with Images
Graphics Can Make or Break Your Games
Adding Graphics to Your XNA Games
Managing Game Content
Adding Graphic Content to Your XNA Projects
Defining Variables for Your Assets
Loading Game Assets
Using the Rectangle Structure to Manage the Placement of Graphics
Working with Assets
Bringing It All Together
Creating a Picture Viewer
Creating an Electronic Picture Viewer
Summary
9. Adding Sound Effects and Background Music
Adding Audio to Your Games
Adding Audio Files to Your XNA Applications
Defining and Locating Sound Resources
Controlling Sound Playback
Supported Audio File Formats
Adding Sound Effects to Projects
Exercising Additional Control of Audio Playback
Setting the Mood with Background Music
Working with the Computer’s Media Player
Loading a .wma or .mp3 File
Associating Variables with Your Audio Files
Loading Audio Files
Playing Background Music
Creating the Music Machine Application
Importing the Audio Files
Importing the Graphic Files
Importing and Configuring Fonts
Time to Start Coding
Summary
IV. Building Games for the PC, Xbox 360, and Zune
10. Creating Your Own Arcade Game
Key Features Found in Most Computer Games
Controlling a Game’s State
Setting Sprite Size and Shape
Moving Things Around
Detecting When Sprites Move Off the Screen
Managing Collisions
Bounded Sprites
Detecting When Collisions Occur
Going Full Screen
Dealing with Display Overscan
Creating the XNA Breakout Game
Step 1—Creating a New Project
Importing the Audio Files
Importing the Graphic Files
Importing and Configuring Fonts
Step 2—Defining Game World Data
Step 3—Setting Screen Resolution and Full-Screen Mode
Step 4—Initializing Game Play
Step 5—Loading Game Content
Step 6—Updating Game Play
Step 7—Drawing the Game
Step 8—Configuring the Screen
Step 9—Configuring the Ball and Paddle
Step 10—Starting Game Play
Step 11—Processing Player Input
Step 12—Managing Ball Movement
Step 13—Keeping Track of the Bricks
Step 14—Redisplaying the Bricks
Step 15—Displaying the Splash Screen
Summary
11. Porting Your Games to the Xbox 360 and Zune Player
Deploying Your XNA Games to Other Platforms
Setting Up Connections
Developing Cross-Platform Games
Creating a Platform-Specific Game
Converting a Windows Game to Another Platform
Platform Issues to Consider
Differences in Input
Audio Compatibility
Handling Different Screen Sizes and Resolution
Conditional Compilation
Submitting Your Games to the XNA Creators Club
Learning How to Handle Errors
Syntax Errors
Logical Errors
Runtime Errors
Using Breakpoints to Control Application Execution
Establishing Breakpoints
Stepping through Application Execution
Edit and Continue
Developing Exception Handlers
Structured Exception Handlers
Summary
V. Appendices
A. What’s on the Companion Website?
Downloading the Book’s Source Code
B. What’s Next?
Locating XNA Resources Online
The XNA Developer Center Website
The Wikipedia Microsoft XNA Page
The xnPlay Website
The XBLA and XNA Ratings Page
The XNA Creators Club Online Website
The XNA Team Blog
The Forums Located at the Creators Club Online
Locating Additional Information on Microsoft Visual C# 2008 Express
The Visual C# Development Center
The Visual C# 2008 Express Edition Page
The Wikipedia C Sharp Page
Other Game Development Resources
The Xbox 360
The Xbox Website
Wikipedia’s Xbox 360 Page
The Zune Portable Media Player
The Zune Website
Wikipedia’s Zune Page
The Author’s Website
Glossary
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
9. Adding Sound Effects and Background Music
Next
Next Chapter
10. Creating Your Own Arcade Game
Part IV. Building Games for the PC, Xbox 360, and Zune
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset