11 Getting Player Input Using a Gamepad Session 3.1.

Slides:



Advertisements
Similar presentations
Chapter 4 Computation Bjarne Stroustrup
Advertisements

RAPTOR Syntax and Semantics By Lt Col Schorsch
11 Reaction Timer Game Session 8.1. Session Overview  Find out how an XNA program can measure the passage of time and trigger events at certain points.
Flappy bird guide for Scratch
Bug Session One. Session description In this session, pupils are introduced to a programming sequence which will make a light pattern on their Bug. Objectives.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
COMPUTER PROGRAMMING 2 Chapter 7 Sound. Objectives Find out how to prepare sounds for inclusion in Microsoft XNA projects. Incorporate sounds into XNA.
Using Objects. Overview In this presentation we will discuss: –Classes and objects –Methods for objects –Printing results.
Input from Controller and Keyboard in XNA Game Studio Express Game Design Experience Professor Jim Whitehead February 12, 2008 Creative Commons Attribution.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
SUNY Morrisville-Norwich Campus-Week 12 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
28-Jun-15 Using Objects. 2 Overview In this presentation we will discuss: Classes and objects Methods for objects Printing results.
Android Apps: Building Blocks Module 6, Intro to I.T., Fall 2011 Sam Scott.
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Bug Session One. Session description In this session, pupils are introduced to a programming sequence which will make a light pattern on their Bug. Objectives.
CHAPTER 1 XNA Game Studio 4.0. Your First Project A computer game is not just a program—it is also lots of other bits and pieces that make playing the.
INTRODUCTION TO THE SCRATCH PROGRAMMING ENVIRONMENT.
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
CHAPTER 4 Images XNA Game Studio 4.0. Objectives Find out how the Content Manager lets you add pictures to Microsoft XNA games. Discover how pictures.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
11 Finding Winners Using Arrays Session 8.2. Session Overview  Find out how the C# language makes it easy to create an array that contains multiple values.
COMPUTER PROGRAMMING 2 Timers. Game Idea: Mob Reaction Timer Use a timer variable to keep track of time and a variable for each player to measure the.
11 A First Game Program Session Session Overview  Begin the creation of an arcade game  Learn software design techniques that apply to any form.
1 CSC 221: Computer Programming I Spring 2010 interaction & design  modular design: roulette game  constants, static fields  % operator, string equals.
Developing the Game User Interface (UI) Lesson 5.
11 Adding Sounds Session 7.1. Session Overview  Find out how to capture and manipulate sound on a Windows PC  Show how sound is managed as an item of.
Microsoft Tech Days 2012 Cheezia: Developing a Windows Phone XNA Game Rodrigo Barretto Software Engineer - MCPD on Windows Phone
 Java has the logical operators and, or, and not, symbolized by &&, ||, and !, respectively.  Logical or means one or the other or both conditions hold.
11 Using the Keyboard Session Session Overview  Introduce the keyboard device  Show how keys on a keyboard can be represented by enumerated types.
Rob Miles. Creating a Working MoodLight We know that colours in XNA are stored as values which represent the amount of red, blue, green and transparency.
CS PC/CONSOLE GAME PROGRAMMING/DEVELOPMENT CHAPTER 2: DRAWING, DATA AND CONTROLS.
11 Working with Images Session Session Overview  Find out more about image manipulation and scaling when drawing using XNA  Start to implement.
11 Adding Tomato Targets Session Session Overview  We now have a game which lets a player bounce a piece of cheese on a bread bat  Now we have.
11 Making a Sprite Session 4.2. Session Overview  Describe the principle of a game sprite, and see how to create a sprite in an XNA game  Learn more.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
CMP-MX21: Lecture 4 Selections Steve Hordley. Overview 1. The if-else selection in JAVA 2. More useful JAVA operators 4. Other selection constructs in.
Rob Miles. How does an XNA game program work? Programs tell computers what to do A program is written in a programming language – C# is a programming.
Game Maker – Getting Started What is Game Maker?.
Algorithms Writing instructions in the order they should execute.
CHAPTER 3 Getting Player Input XNA Game Studio 4.0.
CHAPTER 6 Multiplayer XNA Game Studio 4.0. Objectives Discover how to detect and use individual button-press events in a game. Learn how to create and.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
CHAPTER 2 The Game Loop - Variables, Types, Classes and Objects in XNA XNA Game Studio 4.0.
11 Writing Text Session 5.1. Session Overview  Show how fonts are managed in computers  Discover the difference between bitmap fonts and vector fonts.
11 Debugging Programs Session Session Overview  Create and test a method to calculate percentages  Discover how to use Microsoft Visual Studio.
11 Computers, C#, XNA, and You Session 1.1. Session Overview  Find out what computers are all about ...and what makes a great programmer  Discover.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
11 Adding a Bread Bat Session Session Overview  We have created a cheese sprite that bounces around the display  We now need to create a bread.
Traditionally ladder logic programs have been written by thinking about the process and then beginning to write the program. This always leads to programs.
11 Using the Keyboard in XNA Session 9.1. Session Overview  Discover more detail on how the XNA keyboard is implemented  Find out how to use arrays.
Rob Miles. Using data in an XNA game program An XNA game program Draw and Update methods that are called to run the game Colours are held in XNA as four.
11 Adding Vibration Effects Session Session Overview  Describe how the vibration feature of the gamepad works  Show how an XNA program can control.
Rob Miles. Creating a Broken MoodLight An XNA game contains game data which is used by the Draw and Update methods – Update updates the game data – Draw.
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
09/06/ Data Representation ASCII, Binary Denary Conversion, Integer & Boolean data types.
2D Graphics CMT3311. This covers... How to make a transparent sprite How to add a sprite to your project and draw it Properties of sprites and how to.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Python Programming Module 4 Sensors and Loops Python Programming, 2/e1.
11 Making Decisions in a Program Session 2.3. Session Overview  Introduce the idea of an algorithm  Show how a program can make logical decisions based.
CHAPTER 5 Text XNA Game Studio 4.0. Objectives Discover how text is drawn using Microsoft XNA. Add some font resources to your XNA program. Draw some.
Scratch for Interactivity
Lecture 2 Richard Gesick
Creating a Multi-Player Game
Mindsensors PSP-Nx Controller Simon Game
Using Objects 21-Nov-18.
Creating a Simple Game in Scratch
Agenda for Unit 5: Control Structures
Presentation transcript:

11 Getting Player Input Using a Gamepad Session 3.1

Session Overview  Introduce the gamepad device  Show how a C# object can be used to represent the state of a gamepad  Find out how to use the properties of the GamePadState object in a program  Create a Mood Light that is controlled by the gamepad  Discover how to use logical operators OR and AND  Create our first XNA multiplayer game  Introduce the gamepad device  Show how a C# object can be used to represent the state of a gamepad  Find out how to use the properties of the GamePadState object in a program  Create a Mood Light that is controlled by the gamepad  Discover how to use logical operators OR and AND  Create our first XNA multiplayer game Chapter 3.1: Getting Player Input Using a Gamepad2

A User-Controlled Mood Light  We are going to make a Mood Light that is controlled by the user  They will press the buttons on the gamepad to control the brightness and color of the screen background  The user can select any color that they want  This can also serve as the basis of a game  To do this we need to know how XNA games get input from the player  We are going to make a Mood Light that is controlled by the user  They will press the buttons on the gamepad to control the brightness and color of the screen background  The user can select any color that they want  This can also serve as the basis of a game  To do this we need to know how XNA games get input from the player Chapter 3.1: Getting Player Input Using a Gamepad3

The Xbox Gamepad  The gamepad is a very complex device  It is connected to the host either by USB or a wireless connection  It can be used with a Windows PC or an Xbox  You can obtain a wireless adapter for the Windows PC  The gamepad is a very complex device  It is connected to the host either by USB or a wireless connection  It can be used with a Windows PC or an Xbox  You can obtain a wireless adapter for the Windows PC Chapter 3.1: Getting Player Input Using a Gamepad4

The Zune Buttons  The Zune buttons work in the same way as the buttons on a gamepad  The same XNA program can work with a gamepad or a Zune  However, the Zune doesn’t provide all the buttons that a gamepad does  The Zune buttons work in the same way as the buttons on a gamepad  The same XNA program can work with a gamepad or a Zune  However, the Zune doesn’t provide all the buttons that a gamepad does Chapter 3.1: Getting Player Input Using a Gamepad5

Software and Objects  We know that C# programs are made up of objects that bring together data and behaviors  A game has Game World data and draw and update methods  The state of a gamepad can be represented by a C# object called a GamePadState object  This contains the information about the state of the gamepad at a particular instant  The GamePadState object also provides properties you can use to read this status information  We know that C# programs are made up of objects that bring together data and behaviors  A game has Game World data and draw and update methods  The state of a gamepad can be represented by a C# object called a GamePadState object  This contains the information about the state of the gamepad at a particular instant  The GamePadState object also provides properties you can use to read this status information Chapter 3.1: Getting Player Input Using a Gamepad6

The GamePadState object  A GamePadState object contains information about all the input devices the gamepad has  We are going to consider just the buttons and the DPad at the moment  When the Red button (B) is pressed we want the redIntensity value of the background color to increase  A GamePadState object contains information about all the input devices the gamepad has  We are going to consider just the buttons and the DPad at the moment  When the Red button (B) is pressed we want the redIntensity value of the background color to increase Chapter 3.1: Getting Player Input Using a Gamepad7 GamePadState Buttons DPad

Creating a GamePadState Variable  The game will use a variable to hold the state of the gamepad  It will then test the values of the buttons in this variable so that the gamepad can be used to control the game  The variable must be declared like any other variable in the game program  It has been given the identifier pad1  The game will use a variable to hold the state of the gamepad  It will then test the values of the buttons in this variable so that the gamepad can be used to control the game  The variable must be declared like any other variable in the game program  It has been given the identifier pad1 Chapter 3.1: Getting Player Input Using a Gamepad8 GamePadState pad1;

The pad1 Variable  Each time that update is called, the pad1 variable is set with the state of the gamepad for player 1  Code in the update method will use this variable  Should the pad1 variable be a local variable or a member of the Game1 class?  Member variables are shared between all the methods in a class  Local variables are just used inside the body of a method and discarded when no longer required  Each time that update is called, the pad1 variable is set with the state of the gamepad for player 1  Code in the update method will use this variable  Should the pad1 variable be a local variable or a member of the Game1 class?  Member variables are shared between all the methods in a class  Local variables are just used inside the body of a method and discarded when no longer required Chapter 3.1: Getting Player Input Using a Gamepad9

Using Local Variables  The variable pad1 should be local to the update method  We don’t want to retain the value of gamepad states from previous calls of update  No other methods need to use the value of pad1  Deciding which variables should be local and which should be members is part of the program design process  The variable pad1 should be local to the update method  We don’t want to retain the value of gamepad states from previous calls of update  No other methods need to use the value of pad1  Deciding which variables should be local and which should be members is part of the program design process Chapter 3.1: Getting Player Input Using a Gamepad10

Setting the pad1 Variable  We can set the value of pad1 when we declare it  The XNA Framework provides a class called GamePad that exposes a getState method  The getState method is told which gamepad to get the state of  We don’t need to know how getState works, just how to call it and what the type of the result is  We can set the value of pad1 when we declare it  The XNA Framework provides a class called GamePad that exposes a getState method  The getState method is told which gamepad to get the state of  We don’t need to know how getState works, just how to call it and what the type of the result is Chapter 3.1: Getting Player Input Using a Gamepad11 GamePadState pad1 = GamePad.GetState (PlayerIndex.One) ;

GamePadState Properties  A property is member of a class that represents some data in the class  They can be set up to be read or written, or both  The GamePadState properties can only be read  Each of the properties can contain several values  A property is member of a class that represents some data in the class  They can be set up to be read or written, or both  The GamePadState properties can only be read  Each of the properties can contain several values Chapter 3.1: Getting Player Input Using a Gamepad12 GamePadState Buttons DPad

Game Update Behavior  This condition tests the state of the B (Red) button  If the button is Pressed the condition adds 1 to the value of redIntensity  If the button is held down successive calls of update will cause the redIntensity to increase  The equality operator is used because we are comparing the state of Buttons.B with the value ButtonState.Pressed  This condition tests the state of the B (Red) button  If the button is Pressed the condition adds 1 to the value of redIntensity  If the button is held down successive calls of update will cause the redIntensity to increase  The equality operator is used because we are comparing the state of Buttons.B with the value ButtonState.Pressed Chapter 3.1: Getting Player Input Using a Gamepad13 if (pad1.Buttons.B == ButtonState.Pressed) redIntensity++;

Game Update Behavior  This is the code that allows a game to control the red intensity using button B on a gamepad  Create a local variable called pad1 that contains the state of the gamepad for player 1  Get the state of button B out of the Buttons in the pad, and if the button is pressed, increase the value of redIntensity.  This is the code that allows a game to control the red intensity using button B on a gamepad  Create a local variable called pad1 that contains the state of the gamepad for player 1  Get the state of button B out of the Buttons in the pad, and if the button is pressed, increase the value of redIntensity. Chapter 3.1: Getting Player Input Using a Gamepad14 GamePadState pad1 = GamePad.GetState(PlayerIndex.One); if (pad1.Buttons.B == ButtonState.Pressed) redIntensity++; GamePadState pad1 = GamePad.GetState(PlayerIndex.One); if (pad1.Buttons.B == ButtonState.Pressed) redIntensity++;

1. User-Controlled Red Light Chapter 3.1: Getting Player Input Using a Gamepad15  This version of Mood Light uses the code above to control the redIntensity value  When the Red button is pressed the screen redIntensity value gets larger  This version of Mood Light uses the code above to control the redIntensity value  When the Red button is pressed the screen redIntensity value gets larger

Controlling Green and Blue  The same code construction can be used to control the green and blue intensity values  Note that we don’t need to get a new GamePadState value each time, the program can just read different properties from the same pad1 value  The same code construction can be used to control the green and blue intensity values  Note that we don’t need to get a new GamePadState value each time, the program can just read different properties from the same pad1 value Chapter 3.1: Getting Player Input Using a Gamepad16 GamePadState pad1 = GamePad.GetState(PlayerIndex.One); if (pad1.Buttons.B == ButtonState.Pressed) redIntensity++; if (pad1.Buttons.A == ButtonState.Pressed) greenIntensity++; if (pad1.Buttons.X == ButtonState.Pressed) blueIntensity++; GamePadState pad1 = GamePad.GetState(PlayerIndex.One); if (pad1.Buttons.B == ButtonState.Pressed) redIntensity++; if (pad1.Buttons.A == ButtonState.Pressed) greenIntensity++; if (pad1.Buttons.X == ButtonState.Pressed) blueIntensity++;

Controlling Yellow Intensity Using the Y Button  The gamepad has a Yellow button (Y)  We can increase the yellow intensity by increasing both red and green when this button is pressed  To achieve this, the two update statements must be placed in a block after the condition  The gamepad has a Yellow button (Y)  We can increase the yellow intensity by increasing both red and green when this button is pressed  To achieve this, the two update statements must be placed in a block after the condition Chapter 3.1: Getting Player Input Using a Gamepad17 if (pad1.Buttons.Y == ButtonState.Pressed) { redIntensity++; greenIntensity++; } if (pad1.Buttons.Y == ButtonState.Pressed) { redIntensity++; greenIntensity++; }

2. User-Controlled Light Chapter 3.1: Getting Player Input Using a Gamepad18  This version of Mood Light uses all the gamepad buttons to control the background color

Adding Zune Support Using the DPad  The Zune does not have all of the buttons on the gamepad  However it does have a DPad which can be pressed in one of four directions  We could make a “Mood Flashlight” by using the DPad to control the colors  Then the program would work on the Zune as well  The Zune does not have all of the buttons on the gamepad  However it does have a DPad which can be pressed in one of four directions  We could make a “Mood Flashlight” by using the DPad to control the colors  Then the program would work on the Zune as well Chapter 3.1: Getting Player Input Using a Gamepad19

Controlling Red Using the DPad.Right Value  The GamePadState type contains a DPad property which gives the states of the Left, Right, Up, and Down positions of the DPad  These are used in exactly the same way as the colored buttons on the gamepad  If any button state is equal to the value ButtonState.Pressed it means that the direction is selected on the gamepad  The GamePadState type contains a DPad property which gives the states of the Left, Right, Up, and Down positions of the DPad  These are used in exactly the same way as the colored buttons on the gamepad  If any button state is equal to the value ButtonState.Pressed it means that the direction is selected on the gamepad Chapter 3.1: Getting Player Input Using a Gamepad20 if (pad1.DPad.Right == ButtonState.Pressed) redIntensity++;

Combining Tests Using Logical OR  We want to make the red light brighter if button B (Red) is pressed or Right is pressed on the DPad  We can do this by having two separate if statements  However, it would be neater to be able to use a single condition: “If Button B is pressed OR DPad Right is pressed increase the value of redIntensity”  C# provides a logical operator to allow this  We must use the logical OR operator  We want to make the red light brighter if button B (Red) is pressed or Right is pressed on the DPad  We can do this by having two separate if statements  However, it would be neater to be able to use a single condition: “If Button B is pressed OR DPad Right is pressed increase the value of redIntensity”  C# provides a logical operator to allow this  We must use the logical OR operator Chapter 3.1: Getting Player Input Using a Gamepad21

The Logical OR operator  The logical OR operator is two vertical bars - ||  It works between Boolean values (i.e. true or false)  If either of the values on each side are true, the result it gives is true  The above code increases redIntensity if either button is pressed  The logical OR operator is two vertical bars - ||  It works between Boolean values (i.e. true or false)  If either of the values on each side are true, the result it gives is true  The above code increases redIntensity if either button is pressed Chapter 3.1: Getting Player Input Using a Gamepad22 if (pad1.DPad.Right == ButtonState.Pressed || pad1.Buttons.B == ButtonState.Pressed) { redIntensity++; } if (pad1.DPad.Right == ButtonState.Pressed || pad1.Buttons.B == ButtonState.Pressed) { redIntensity++; }

Logical OR Test  Logical OR works between any two conditions that return a Boolean result  We can use it between the values true and false  Although this might result in compiler warnings  Which of the above statements would increase the value of redIntensity ?  Logical OR works between any two conditions that return a Boolean result  We can use it between the values true and false  Although this might result in compiler warnings  Which of the above statements would increase the value of redIntensity ? Chapter 3.1: Getting Player Input Using a Gamepad23 if (true || false ) redIntensity++; if (true || true ) redIntensity++; if (false|| false ) redIntensity++; if (true || false ) redIntensity++; if (true || true ) redIntensity++; if (false|| false ) redIntensity++;

Logical OR Test  The OR operator returns true if either of the conditions on each side of the operator is true  Therefore it only returns false if both the conditions are false  The OR operator returns true if either of the conditions on each side of the operator is true  Therefore it only returns false if both the conditions are false Chapter 3.1: Getting Player Input Using a Gamepad24 if (true || false ) redIntensity++; // increases if (true || true ) redIntensity++; // increases if (false || false ) redIntensity++; // doesn’t increase if (true || false ) redIntensity++; // increases if (true || true ) redIntensity++; // increases if (false || false ) redIntensity++; // doesn’t increase

Logical AND  There is also a logical AND operator  We could use this to make the program reset all the colors to 0 if both triggers are pressed on the gamepad  This makes it harder to reset the colors by mistake  The logical AND condition only works out to true if the conditions on both sides are true  The logical AND operator is the character sequence &&  There is also a logical AND operator  We could use this to make the program reset all the colors to 0 if both triggers are pressed on the gamepad  This makes it harder to reset the colors by mistake  The logical AND condition only works out to true if the conditions on both sides are true  The logical AND operator is the character sequence && Chapter 3.1: Getting Player Input Using a Gamepad25

Logical AND Value Reset  The program can test the values of the shoulder buttons on the controller  If both of them are pressed the block of code is performed  This resets the intensity values to 0  The program can test the values of the shoulder buttons on the controller  If both of them are pressed the block of code is performed  This resets the intensity values to 0 Chapter 3.1: Getting Player Input Using a Gamepad26 if (pad1.Buttons.LeftShoulder == ButtonState.Pressed && pad1.Buttons.RightShoulder == ButtonState.Pressed) { redIntensity = 0; greenIntensity = 0; blueIntensity = 0; } if (pad1.Buttons.LeftShoulder == ButtonState.Pressed && pad1.Buttons.RightShoulder == ButtonState.Pressed) { redIntensity = 0; greenIntensity = 0; blueIntensity = 0; }

3. Fully Functional Light Chapter 3.1: Getting Player Input Using a Gamepad27  This version of the Mood Light will work on Zune, Windows PC or Xbox  It also provides the reset behavior with the shoulder buttons  This version of the Mood Light will work on Zune, Windows PC or Xbox  It also provides the reset behavior with the shoulder buttons

Game Idea – Color Nerve  You can use this program as the basis of a game:  Players take turns to press any buttons they like on the gamepad (but they must change the color on the screen)  If the screen flashes from bright to dark (i.e. an intensity value wraps around) during a turn that player is out  The game continues until one player is left to become the winner  Press the shoulder buttons to reset for the next game  You can use this program as the basis of a game:  Players take turns to press any buttons they like on the gamepad (but they must change the color on the screen)  If the screen flashes from bright to dark (i.e. an intensity value wraps around) during a turn that player is out  The game continues until one player is left to become the winner  Press the shoulder buttons to reset for the next game Chapter 3.1: Getting Player Input Using a Gamepad28

Summary  The XNA Framework uses the type GamePadState to represent the state of a gamepad in a game  The GamePad class, which is part of XNA, provides a getState method that can be used to get the GamePadState value for the selected player  The GamePadState type exposes properties that can be read to get the state of the gamepad  These states can be combined using logical operators to allow more complicated behaviors to be created in a program  The XNA Framework uses the type GamePadState to represent the state of a gamepad in a game  The GamePad class, which is part of XNA, provides a getState method that can be used to get the GamePadState value for the selected player  The GamePadState type exposes properties that can be read to get the state of the gamepad  These states can be combined using logical operators to allow more complicated behaviors to be created in a program Chapter 3.1: Getting Player Input Using a Gamepad29

True/False Revision Quiz  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program.  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program. Chapter 3.1: Getting Player Input Using a Gamepad30

True/False Revision Quiz  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program.  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program. Chapter 3.1: Getting Player Input Using a Gamepad31

True/False Revision Quiz  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program.  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program. Chapter 3.1: Getting Player Input Using a Gamepad32

True/False Revision Quiz  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program.  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program. Chapter 3.1: Getting Player Input Using a Gamepad33

True/False Revision Quiz  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program.  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program. Chapter 3.1: Getting Player Input Using a Gamepad34

True/False Revision Quiz  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program.  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by || in a program. Chapter 3.1: Getting Player Input Using a Gamepad35

True/False Revision Quiz  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by|| in a program.  An XNA program can control the state of the buttons on a gamepad.  The GamePadState type holds information about the state of a gamepad.  Objects can expose information by means of properties.  An XNA program can only connect to one gamepad.  The Zune has a full set of colored buttons.  The AND operator is represented by|| in a program. Chapter 3.1: Getting Player Input Using a Gamepad36