SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
Game Input,[object Object],Tran Minh Triet – Nguyen KhacHuy,[object Object],Faculty of Information Technology,[object Object],University of Science, VNU-HCM,[object Object]
Game Input,[object Object],XNA Framework supports three input sources,[object Object],Xbox 360 controller,[object Object],Wired controller under Windows,[object Object],Wireless or wired for Xbox 360,[object Object],Up to 4 at a time,[object Object],Keyboard,[object Object],Good default for Windows games,[object Object],Xbox 360 also supports USB keyboards,[object Object],Mouse,[object Object],Windows only (no Xbox 360 support),[object Object],Poll for input,[object Object],Every clock tick, check the state of your input devices,[object Object],Generally works OK for 1/60th second ticks,[object Object]
Digital vs Analog Controls,[object Object],Input devices have two types of controls,[object Object],Digital,[object Object],Reports only two states: on or off,[object Object],Keyboard: keys,[object Object],Controller A, B, X, Y, Back, Start, D-Pad,[object Object],Analog,[object Object],Report a range of values,[object Object],XBox 360 controller: -1.0f to 1.0f,[object Object],Mouse: mouse cursor values (in pixels),[object Object]
Input Type Overview,[object Object]
Keyboard Input,[object Object],Handled via the Keyboard class,[object Object],KeyBoard.GetState() retrieves KeyboardState,[object Object],KeyboardState key methods,[object Object]
Keyboard Input,[object Object],Example: Checking the “A” key was pressed,[object Object],Moving a rings,[object Object],if (Keyboard.GetState().IsKeyDown(Keys.A)),[object Object],                // BAM!!! A is pressed!,[object Object],KeyboardState keyboardState = Keyboard.GetState();,[object Object],if (keyboardState.IsKeyDown(Keys.Left)),[object Object],    ringsPosition.X -= ringsSpeed;,[object Object],if (keyboardState.IsKeyDown(Keys.Right)),[object Object],    ringsPosition.X += ringsSpeed;,[object Object]
Mouse Input,[object Object],Providing a Mouse class to interact,[object Object],Mouse.GetState() retrieves MouseState,[object Object],MouseState important properties,[object Object]
Mouse Input,[object Object]
Mouse Input,[object Object],Example: Moving the ring,[object Object],On Update() method,[object Object],MouseState prevMouseState;,[object Object],MouseState mouseState = Mouse.GetState();,[object Object],if(mouseState.X != prevMouseState.X ||,[object Object],    mouseState.Y != prevMouseState.Y),[object Object],    ringsPosition = new Vector2(mouseState.X, mouseState.Y);,[object Object],prevMouseState = mouseState;,[object Object]
Gamepad Input,[object Object],Other,[object Object],Buttons,[object Object],Buttons,[object Object],X Y A B,[object Object],Digital,[object Object],DPad,[object Object],Down Left Right Up,[object Object]
Gamepad Input,[object Object],Thumb Sticks,[object Object],Left Right,[object Object],Analogue, range -1..+1,[object Object]
Gamepad Input,[object Object],Buttons,[object Object],LeftShoulder,[object Object],RightShoulder,[object Object],Digital,[object Object]
Gamepad Input,[object Object],Triggers,[object Object],Left Right,[object Object],Analogue, range 0..+1,[object Object]
Gamepad Input - GamePad class,[object Object],A static class,[object Object],Do not need to create an instance to use,[object Object],All methods are static,[object Object],GetState,[object Object],Retrieve current state of all inputs on one controller,[object Object],SetVibration,[object Object],Use to make controller vibrate,[object Object],GetCapabilities,[object Object],Determine which input types are supported. ,[object Object],Can check for voice support, and whether controller is connected.,[object Object]
Gamepad Input - GamePadState Struct,[object Object],Properties for reading state,[object Object],Digital Input: Buttons, DPad,[object Object],Analog Input: ThumbSticks, Triggers,[object Object],Check connection state: IsConneced,[object Object],PacketNumber,[object Object],Number increases when gamepad state changes,[object Object],Use to check if player has changed gamepad state since last tick,[object Object]
Gamepad Input - GamePadState Struct,[object Object],publicstruct GamePadState{public static bool operator !=(GamePadState left, GamePadState right);public static bool operator ==(GamePadState left, GamePadState right);,[object Object],public GamePadButtons Buttons { get; }public GamePadDPad DPad { get; }public bool IsConnected { get; }public int PacketNumber { get; }public GamePadThumbSticks ThumbSticks { get; }public GamePadTriggers Triggers { get; }},[object Object]
Gamepad Input - GamePadButtons Struct,[object Object],Properties for retrieving current button state,[object Object],A, B, X, Y,[object Object],Start, Back,[object Object],LeftStick, RightStick,[object Object],When you press straight down on each joystick, is a button press,[object Object],LeftShoulder, RightShoulder,[object Object],Possible values are given by ButtonState enumeration,[object Object],Released – button is up,[object Object],Pressed – button is down,[object Object]
Gamepad Input - GamePadButtons Struct,[object Object],Example,[object Object],// create GamePadState struct ,[object Object],GamePadState m_pad; ,[object Object], // retrieve current controller state ,[object Object],m_pad = GamePad.GetState(PlayerIndex.One); ,[object Object],if (m_pad.Buttons.A == ButtonState.Pressed) ,[object Object],	 // do something if A button pressed| if (m_pad.Buttons.LeftStick == ButtonState.Pressed) ,[object Object],	// do something if left stick button pressed if (m_pad.Buttons.Start == ButtonState.Pressed)      ,[object Object],	// do something if start button pressed,[object Object]
Gamepad Input - GameDPad Struct,[object Object],Properties for retrieving current DPad button state,[object Object],Up, Down, Left, Right,[object Object],Possible values are given by ButtonState enumeration,[object Object],Released – button is up,[object Object],Pressed – button is down,[object Object]
Gamepad Input - GameDPad Struct,[object Object],Example,[object Object],// create GamePadState struct ,[object Object],GamePadState m_pad;,[object Object],// retrieve current controller state m_pad = GamePad.GetState(PlayerIndex.One);,[object Object],// do something if DPad up button pressed| if (m_pad.DPad.Up == ButtonState.Pressed) ,[object Object],// do something if DPad left button pressed if (m_pad.DPad.Left == ButtonState.Pressed) ,[object Object]
Gamepad Input – GamePadThumbsticks Struct,[object Object],Each thumbstick has X, Y position,[object Object],Ranges from -1.0f to 1.0f,[object Object],Left (-1.0f), Right (1.0f), Up (1.0f), Down (-1.0f),[object Object],0.0f indicates not being pressed at all,[object Object],Represented as a Vector2,[object Object],So, have,[object Object],Left.X, Left.Y, Right.X, Right.Y,[object Object]
Gamepad Input – GamePadThumbsticks Struct,[object Object],Example,[object Object],	 // create GamePadState struct,[object Object],	GamePadState m_pad;                ,[object Object],	// retrieve current controller statem_pad = GamePad.GetState(PlayerIndex.One);         ,[object Object],	// do something if Left joystick pressed to right|if (m_pad.Thumbsticks.Left.X > 0.0f)       ,[object Object],	// do something if Right joystick pressed down if (m_pad.Thumbsticks.Right.Y < 0.0f),[object Object]
Gamepad Input – GamePadTriggersStruct,[object Object],Each trigger ranges from 0.0f to 1.0f ,[object Object],Not pressed: 0.0f,[object Object],Fully pressed: 1.0f,[object Object],Represented as a float,[object Object],Have left and right triggers,[object Object],Properties: Left, Right,[object Object],// create GamePadState struct,[object Object],GamePadState m_pad;,[object Object],// retrieve current controller statem_pad = GamePad.GetState(PlayerIndex.One); ,[object Object],if (m_pad.Triggers.Left != 0.0f)                              ,[object Object],	// do something if Left trigger pressed down|if (m_pad.Triggers.Right >= 0.95f)                         ,[object Object],	// do something if Right trigger pressed all the way down ,[object Object]
Gamepad Input – GamePadTriggersStruct,[object Object],Example,[object Object],Each trigger ranges from 0.0f to 1.0f ,[object Object],Not pressed: 0.0f,[object Object],Fully pressed: 1.0f,[object Object],Represented as a float,[object Object],Have left and right triggers,[object Object],Properties: Left, Right,[object Object]
Gamepad Input - Controller Vibration,[object Object],Can set the vibration level of the gamepad,[object Object],Call SetVibration() on GamePad class,[object Object],Pass controller number, left vibration, right vibration,[object Object],Left motor is low frequency,[object Object],Right motor is high-frequency,[object Object],Turn vibration full on, both motors,[object Object],GamePad.SetVibration(PlayerIndex.One, 1.0f, 1.0f);,[object Object],Turn vibration off, both motors,[object Object],GamePad.SetVibration(PlayerIndex.One, 0f, 0f);,[object Object]
Collision detection,[object Object],protected bool Collide(),[object Object],{,[object Object],    Rectangle ringsRect = new Rectangle(,[object Object],        (int)ringsPosition.X + ringsCollisionRectOffset,,[object Object],        (int)ringsPosition.Y + ringsCollisionRectOffset,,[object Object],        ringsFrameSize.X - (ringsCollisionRectOffset * 2),,[object Object],        ringsFrameSize.Y - (ringsCollisionRectOffset * 2));,[object Object],    Rectangle skullRect = new Rectangle(,[object Object],        (int)skullPosition.X + skullCollisionRectOffset,,[object Object],        (int)skullPosition.Y + skullCollisionRectOffset,,[object Object],        skullFrameSize.X - (skullCollisionRectOffset * 2),,[object Object],        skullFrameSize.Y - (skullCollisionRectOffset * 2));,[object Object],    return ringsRect.Intersects(skullRect);,[object Object],},[object Object]
Q&A,[object Object],?,[object Object]
References,[object Object],XNA framework input,[object Object],http:// msdn.microsoft.com/en-us/library/microsoft.xna.framework.input.aspx,[object Object],Controller Images,[object Object],http:// creators.xna.com/en-us/contentpack/controller,[object Object],Ebook,[object Object],Learning XNA 3.0 – Aaron Reed,[object Object]

Contenu connexe

En vedette

Policiamento Ostensivo de Guardas - Complexo da Bahia
Policiamento Ostensivo de Guardas - Complexo da BahiaPoliciamento Ostensivo de Guardas - Complexo da Bahia
Policiamento Ostensivo de Guardas - Complexo da BahiaAlisson Soares
 
Produktberater für Fernsehgeräte des SmartShoppingBlog.de
Produktberater für Fernsehgeräte des SmartShoppingBlog.deProduktberater für Fernsehgeräte des SmartShoppingBlog.de
Produktberater für Fernsehgeräte des SmartShoppingBlog.deUnited Internet Media AG
 
5 fitness quotes that irritate midlife exercisers
5 fitness quotes that irritate midlife exercisers5 fitness quotes that irritate midlife exercisers
5 fitness quotes that irritate midlife exercisersKymberly Williams-Evans, MA
 
Produktberater für Digitalkameras des SmartShoppingBlog.de
Produktberater für Digitalkameras des SmartShoppingBlog.deProduktberater für Digitalkameras des SmartShoppingBlog.de
Produktberater für Digitalkameras des SmartShoppingBlog.deUnited Internet Media AG
 
Manual Ilustrado do Livro de Parte Digital
Manual Ilustrado do Livro de Parte DigitalManual Ilustrado do Livro de Parte Digital
Manual Ilustrado do Livro de Parte DigitalAlisson Soares
 
Sound Effects and Audio
 Sound Effects and Audio Sound Effects and Audio
Sound Effects and Audioboybuon205
 
Chapter 02 sprite and texture
Chapter 02 sprite and textureChapter 02 sprite and texture
Chapter 02 sprite and textureboybuon205
 
Integrate function and cognitive challenges into your older adult fitness groups
Integrate function and cognitive challenges into your older adult fitness groupsIntegrate function and cognitive challenges into your older adult fitness groups
Integrate function and cognitive challenges into your older adult fitness groupsKymberly Williams-Evans, MA
 

En vedette (15)

Policiamento Ostensivo de Guardas - Complexo da Bahia
Policiamento Ostensivo de Guardas - Complexo da BahiaPoliciamento Ostensivo de Guardas - Complexo da Bahia
Policiamento Ostensivo de Guardas - Complexo da Bahia
 
Overview
OverviewOverview
Overview
 
EEX 4070 Action project
EEX 4070 Action projectEEX 4070 Action project
EEX 4070 Action project
 
Produktberater für Fernsehgeräte des SmartShoppingBlog.de
Produktberater für Fernsehgeräte des SmartShoppingBlog.deProduktberater für Fernsehgeräte des SmartShoppingBlog.de
Produktberater für Fernsehgeräte des SmartShoppingBlog.de
 
5 fitness quotes that irritate midlife exercisers
5 fitness quotes that irritate midlife exercisers5 fitness quotes that irritate midlife exercisers
5 fitness quotes that irritate midlife exercisers
 
Produktberater für Digitalkameras des SmartShoppingBlog.de
Produktberater für Digitalkameras des SmartShoppingBlog.deProduktberater für Digitalkameras des SmartShoppingBlog.de
Produktberater für Digitalkameras des SmartShoppingBlog.de
 
Manual Ilustrado do Livro de Parte Digital
Manual Ilustrado do Livro de Parte DigitalManual Ilustrado do Livro de Parte Digital
Manual Ilustrado do Livro de Parte Digital
 
Network
NetworkNetwork
Network
 
Sound Effects and Audio
 Sound Effects and Audio Sound Effects and Audio
Sound Effects and Audio
 
Wk 2010thenders
Wk 2010thendersWk 2010thenders
Wk 2010thenders
 
Chapter 02 sprite and texture
Chapter 02 sprite and textureChapter 02 sprite and texture
Chapter 02 sprite and texture
 
Maps
MapsMaps
Maps
 
Un
UnUn
Un
 
Create a media kit that gets attention
Create a media kit that gets attentionCreate a media kit that gets attention
Create a media kit that gets attention
 
Integrate function and cognitive challenges into your older adult fitness groups
Integrate function and cognitive challenges into your older adult fitness groupsIntegrate function and cognitive challenges into your older adult fitness groups
Integrate function and cognitive challenges into your older adult fitness groups
 

Similaire à Chapter 03 game input

public interface Game Note interface in place of class { .pdf
public interface Game  Note interface in place of class { .pdfpublic interface Game  Note interface in place of class { .pdf
public interface Game Note interface in place of class { .pdfkavithaarp
 
Hello!This is Java assignment applet.Can someone help me writing.pdf
Hello!This is Java assignment applet.Can someone help me writing.pdfHello!This is Java assignment applet.Can someone help me writing.pdf
Hello!This is Java assignment applet.Can someone help me writing.pdfjyothimuppasani1
 
import tio.;class TicTacToe {static final int EMPTY = 0;stati.pdf
import tio.;class TicTacToe {static final int EMPTY = 0;stati.pdfimport tio.;class TicTacToe {static final int EMPTY = 0;stati.pdf
import tio.;class TicTacToe {static final int EMPTY = 0;stati.pdfpreetajain
 
package game;import java.util.Scanner;public class GuessGame {.pdf
package game;import java.util.Scanner;public class GuessGame {.pdfpackage game;import java.util.Scanner;public class GuessGame {.pdf
package game;import java.util.Scanner;public class GuessGame {.pdfanurag1231
 
Programming a guide gui
Programming a guide guiProgramming a guide gui
Programming a guide guiMahmoud Hikmet
 
Please help with this. program must be written in C# .. All of the g.pdf
Please help with this. program must be written in C# .. All of the g.pdfPlease help with this. program must be written in C# .. All of the g.pdf
Please help with this. program must be written in C# .. All of the g.pdfmanjan6
 
The following GUI is displayed once the application startsThe sug.pdf
The following GUI is displayed once the application startsThe sug.pdfThe following GUI is displayed once the application startsThe sug.pdf
The following GUI is displayed once the application startsThe sug.pdfarihantsherwani
 
Need help writing the code for a basic java tic tac toe game Tic.pdf
Need help writing the code for a basic java tic tac toe game Tic.pdfNeed help writing the code for a basic java tic tac toe game Tic.pdf
Need help writing the code for a basic java tic tac toe game Tic.pdfhainesburchett26321
 
Html5 game, websocket e arduino
Html5 game, websocket e arduino Html5 game, websocket e arduino
Html5 game, websocket e arduino Giuseppe Modarelli
 
You will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdfYou will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdfFashionColZone
 
Tetris_game_presentation_for_github.pptx
Tetris_game_presentation_for_github.pptxTetris_game_presentation_for_github.pptx
Tetris_game_presentation_for_github.pptxLiudmilaShurupova
 
Html5 game, websocket e arduino
Html5 game, websocket e arduinoHtml5 game, websocket e arduino
Html5 game, websocket e arduinomonksoftwareit
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptMahyuddin8
 
In Java using Eclipse, Im suppose to write a class that encapsulat.pdf
In Java using Eclipse, Im suppose to write a class that encapsulat.pdfIn Java using Eclipse, Im suppose to write a class that encapsulat.pdf
In Java using Eclipse, Im suppose to write a class that encapsulat.pdfanjandavid
 
The main class of the tictoe game looks like.public class Main {.pdf
The main class of the tictoe game looks like.public class Main {.pdfThe main class of the tictoe game looks like.public class Main {.pdf
The main class of the tictoe game looks like.public class Main {.pdfasif1401
 
((Note Assembly Language programming Please and format from book 8.docx
((Note Assembly Language programming Please and format from book 8.docx((Note Assembly Language programming Please and format from book 8.docx
((Note Assembly Language programming Please and format from book 8.docxajoy21
 
package com.tictactoe; public class Main {public void play() {.pdf
package com.tictactoe; public class Main {public void play() {.pdfpackage com.tictactoe; public class Main {public void play() {.pdf
package com.tictactoe; public class Main {public void play() {.pdfinfo430661
 
Develop a game, with two gamers. Games rules made up themselfs. F.docx
   Develop a game, with two gamers. Games rules made up themselfs. F.docx   Develop a game, with two gamers. Games rules made up themselfs. F.docx
Develop a game, with two gamers. Games rules made up themselfs. F.docxShiraPrater50
 

Similaire à Chapter 03 game input (20)

public interface Game Note interface in place of class { .pdf
public interface Game  Note interface in place of class { .pdfpublic interface Game  Note interface in place of class { .pdf
public interface Game Note interface in place of class { .pdf
 
Hello!This is Java assignment applet.Can someone help me writing.pdf
Hello!This is Java assignment applet.Can someone help me writing.pdfHello!This is Java assignment applet.Can someone help me writing.pdf
Hello!This is Java assignment applet.Can someone help me writing.pdf
 
import tio.;class TicTacToe {static final int EMPTY = 0;stati.pdf
import tio.;class TicTacToe {static final int EMPTY = 0;stati.pdfimport tio.;class TicTacToe {static final int EMPTY = 0;stati.pdf
import tio.;class TicTacToe {static final int EMPTY = 0;stati.pdf
 
package game;import java.util.Scanner;public class GuessGame {.pdf
package game;import java.util.Scanner;public class GuessGame {.pdfpackage game;import java.util.Scanner;public class GuessGame {.pdf
package game;import java.util.Scanner;public class GuessGame {.pdf
 
grahics
grahicsgrahics
grahics
 
Programming a guide gui
Programming a guide guiProgramming a guide gui
Programming a guide gui
 
Please help with this. program must be written in C# .. All of the g.pdf
Please help with this. program must be written in C# .. All of the g.pdfPlease help with this. program must be written in C# .. All of the g.pdf
Please help with this. program must be written in C# .. All of the g.pdf
 
The following GUI is displayed once the application startsThe sug.pdf
The following GUI is displayed once the application startsThe sug.pdfThe following GUI is displayed once the application startsThe sug.pdf
The following GUI is displayed once the application startsThe sug.pdf
 
Need help writing the code for a basic java tic tac toe game Tic.pdf
Need help writing the code for a basic java tic tac toe game Tic.pdfNeed help writing the code for a basic java tic tac toe game Tic.pdf
Need help writing the code for a basic java tic tac toe game Tic.pdf
 
Html5 game, websocket e arduino
Html5 game, websocket e arduino Html5 game, websocket e arduino
Html5 game, websocket e arduino
 
You will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdfYou will write a multi-interface version of the well-known concentra.pdf
You will write a multi-interface version of the well-known concentra.pdf
 
Tetris_game_presentation_for_github.pptx
Tetris_game_presentation_for_github.pptxTetris_game_presentation_for_github.pptx
Tetris_game_presentation_for_github.pptx
 
Of class2
Of class2Of class2
Of class2
 
Html5 game, websocket e arduino
Html5 game, websocket e arduinoHtml5 game, websocket e arduino
Html5 game, websocket e arduino
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.ppt
 
In Java using Eclipse, Im suppose to write a class that encapsulat.pdf
In Java using Eclipse, Im suppose to write a class that encapsulat.pdfIn Java using Eclipse, Im suppose to write a class that encapsulat.pdf
In Java using Eclipse, Im suppose to write a class that encapsulat.pdf
 
The main class of the tictoe game looks like.public class Main {.pdf
The main class of the tictoe game looks like.public class Main {.pdfThe main class of the tictoe game looks like.public class Main {.pdf
The main class of the tictoe game looks like.public class Main {.pdf
 
((Note Assembly Language programming Please and format from book 8.docx
((Note Assembly Language programming Please and format from book 8.docx((Note Assembly Language programming Please and format from book 8.docx
((Note Assembly Language programming Please and format from book 8.docx
 
package com.tictactoe; public class Main {public void play() {.pdf
package com.tictactoe; public class Main {public void play() {.pdfpackage com.tictactoe; public class Main {public void play() {.pdf
package com.tictactoe; public class Main {public void play() {.pdf
 
Develop a game, with two gamers. Games rules made up themselfs. F.docx
   Develop a game, with two gamers. Games rules made up themselfs. F.docx   Develop a game, with two gamers. Games rules made up themselfs. F.docx
Develop a game, with two gamers. Games rules made up themselfs. F.docx
 

Chapter 03 game input

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.

Notes de l'éditeur

  1. Control the objects on the screen and give your application some user interaction. Mouse input is never available on the Xbox360,andThe Zune only supports its emulated controls—you won’t be plugginga mouse, a keyboard, or any other input devices into a Zune anytime soon.
  2. Using the Microsoft.XNA.Framework.Input namespace
  3. XButton1, XButton2:Returns the state of additional buttons on some mice.
  4. Microsoft Permissive License (Ms-PL) This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. 1. DefinitionsThe terms “reproduce,” “reproduction,” “derivative works,” and “distribution” have the same meaning here as under U.S. copyright law.A “contribution” is the original software, or any additions or changes to the software.A “contributor” is any person that distributes its contribution under this license. “Licensed patents” are a contributor’s patent claims that read directly on its contribution. 2. Grant of Rights(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. 3. Conditions and Limitations (A) No Trademark License- This license does not grant you rights to use any contributors’ name, logo, or trademarks.(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.(E) The software is licensed “as-is.” You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
  5. If you’re developing a game for Windows, you can still program for an Xbox 360 controller.You’ll have to have a wired controller, or you can purchase an Xbox 360 Wireless Receiver for around $20, which will allow you to connect up to four wireless controllers to a PC.
  6. Ý tưởng đơn giản là xác định khung chữ nhật của 2 sprite và dùng phương thức Intersects để kiểm tra có đụng độ hay không