SlideShare una empresa de Scribd logo
1 de 66
Microsoft’s XNA
                    Sjors Miltenburg
              Software Ontwikkelaar



               smiltenburg@sogyo.nl
          www.software-innovators.nl
Who?
Who?
First video game, 1958
First video game, 1958
Spacewar, 1962
The Galaxy Game, 1971
Pong, 1972
Spaceinvader, 1978
Commodore, 1982
Super Mario Bros, 1985
Wolfenstein 3D, 1992
Duke Nukem 3D, 1996
Call of Duty 4, 2007
Facts

     USA [2007]
     $ 17.9 billion




NL game industry
bigger than film
industry
Microsoft & gaming
XNA
• tools for game development

• Completely managed environment

• All aspects of game production in one
  system

• Game development is accessible
XNA Platform
• XNA Framework

• XNA Build

• XNA Framework Content Pipeline

• XNA Game Studio
What do you need?
    .NET 3.0
•
    Visual Studio (C# Express is free!)
•
    XNA Framework
•
    XNA Game Studio
•
XNA Framework
• Microsoft .NET CLR 3.0 (3.5?)

• Cross-Platform Game Development
   – Windows XP
   – Windows Vista
   – Xbox 360 
   – Zune
XNA Framework overview
   Games                                     Code               Content     Components
                      Starter Kits




   Extended
                            Application Model                      Content Pipeline
   Framework




   Core
                      Graphics         Audio          Input          Math       Storage
   Framework




   Platform                                  XACT               XINPUT        XContent
                          Direct3D




Legend                                              Community
           XNA Provides        You Provide
XNA Framework overview
   Games                                     Code               Content     Components
                      Starter Kits




   Extended
                            Application Model                      Content Pipeline
   Framework




   Core
                      Graphics         Audio          Input          Math       Storage
   Framework




   Platform                                  XACT               XINPUT        XContent
                          Direct3D




Legend                                              Community
           XNA Provides        You Provide
Starter Kits
  “Take our games and make them your own”

• “Complete” games
      Starting point for your own games
  –
      Available through “New Project…”
  –
      Hit F5 and done!
  –
      Documentation and tutorials
  –
Components
• They use the standard gameloop
    –   Initialize, Load, Update, Draw, Unload



    Create and re-use functionality
•
    Use 3rd party components
•
    Community has a standard
•
    Menus, virtual keyboard, game engine,
•
    game info, radar’s, map, etc…
Components
• Example of a Component
  – Virtual keyboard voor de XBOX 360
XNA Framework overview
   Games                                     Code               Content     Components
                      Starter Kits




   Extended
                            Application Model                      Content Pipeline
   Framework




   Core
                      Graphics         Audio          Input          Math       Storage
   Framework




   Platform                                  XACT               XINPUT        XContent
                          Direct3D




Legend                                              Community
           XNA Provides        You Provide
Application Model
• Platform abstraction
  – Don’t worry about the platform


• First line of code is for your game

• Game class
  – Starting point for your game
Application Model
         Game Class, starting point
• Game
  – Initialize
  – LoadContent
  – Update
  – Draw
  – UnloadContent
• GameComponent,
  DrawableGameComponent
Content Pipeline
    extensible content processing framework
•
    2D File Formats (.DDS, .BMP, .JPG, .PNG, .TGA)
•
    3D File Formats (.FBX, .X)
•
    Material File Formats (.FX)
•
    Audio File Formats (.XAP)
•
XNA Framework overview
   Games                                     Code               Content     Components
                      Starter Kits




   Extended
                            Application Model                      Content Pipeline
   Framework




   Core
                      Graphics         Audio          Input          Math       Storage
   Framework




   Platform                                  XACT               XINPUT        XContent
                          Direct3D




Legend                                              Community
           XNA Provides        You Provide
Core Framework
• Graphics
   – SpriteBatch, BasicEffect, Texture2d,
     GraphicsDevice, Model, VertexBuffer
• Audio
   – SoundBank, WaveBank, Cue, AudioEngine
   – Looping, Streaming en memory management
   – low-level buffer management
• Input
   – GamePad, Keyboard, Mouse
Core Framework
• Math
   – MathHelper.ToRadians(float angle), PiOver4


• Storage
   – Title Storage (Shaders, Meshes, Textures, Sounds…)
   – User Storage (Save games, Scores…)
   – Emulated on the Windows Platform

• Network
   – NetworkSession, PacketReader, NetworkGamer
XNA Framework Overzicht
   Games                                     Code               Content     Components
                      Starter Kits




   Extended
                            Application Model                      Content Pipeline
   Framework




   Core
                      Graphics         Audio          Input          Math       Storage
   Framework




   Platform                                  XACT               XINPUT        XContent
                          Direct3D




Legend                                              Community
           XNA Provides        You Provide
Platform abstraction
• Don’t worry about the platform, but
  about your game!

• Mono started an implementation
XACT
• Microsoft Cross-Platform Audio Creation
  Tool
• Create audio files for XNA games
• Compiles .wav files
• Add info to the sound
  – Looping, volume levels
Community
• 3D Models
  – Cars, Houses, humans, levels
• Mostly free
• http://turbosquid.com/xna
Community
• Example of a community built Component
  – XNA Console
Deployment to Xbox 360
• What do you need to deploy to Xbox 360?
  – Xbox Live Account
  – XNA Game Launcher
  – Connection to computer
  – XNA Creators Club account


• XNA Creators Club account
  – 49 euro (4 months)
  – 99 euro (1 year)
Getting creative
• Creating games with XNA is easy!
We will be building
• Tank game
  – Drive, aim and shoot
Steps
    Run an empty game
•
    Load graphical content
•
    Show tank on screen
•
    Handle user input
•
    – Rotate
    – Move
    – Shoot
Step 1: Empty game
• Create a new XNA game
• Run!
Step 2: Load Content
• Create a Tank Class
  – Vector2 (x,y) for position
  – Float (Radians) for direction


• 3 resources (tank, turret, canonball)
• Texture2D
  – ContentManager.Load<2DTexture>(“Tank”);
Step 3.1: Display content
• Draw tank
• Draw turret

• Draw @ center of the screen
• Does it matter what you draw first?
Step 3.2: Display content
• SpriteBatch.Begin();
• SpriteBatch.Draw(7 implementations);
• SpriteBatch.End();

• Screen
  – GraphicsManager.GraphicsDevice.Viewport
  – 0,0 = top left corner
  – 800,600 = bottom right corner
Step 4: Handle User input
• KeyboardState = Keyboard.GetState();
• If (KeyboardState.isKeyDown(Keys.Up));
• Where do we place this code?

• Rotate (Tank & turret)
• Move
• Vector2 Movement = new Vector2();
• Movement.X += moveDist * (float)Math.Cos(Rotation);
• Movement.Y += moveDist * (float)Math.Sin(Rotation);
Step 5: Shoot
• CannonBall Class
• One shot at a time (space invader style)
Step 6: Shoot Enemy
• Draw stationary tank
• Hit?
  – Rectangle.Intersects
  – Advanced: Per pixel collision
  – Where should this code go?
• Draw tank health
  – Add new SpriteFont to content folder
  – Load Content
  – SpriteBatch.DrawString();
Step 7: Network code
• Sample code
  – Search for “XNA Network Prediction”
  – Uses Microsoft Live
    • Create a local account
Resources
    http://creators.xna.com/
•
    http://blogs.msdn.com/xna
•
    http://www.turbosquid.com/xna
•
    http://xbox360homebrew.com
•
    http://www.riemers.net
•
    http://www.xnadevelopment.com
•
    Search for XNA at Google with Live Search
•
Vragen?
Nintendo’s Wii!
Wiimote
    Knoppen
•
    Accelerometer
•
    IR-camera
•
    Buzzer
•
    Leds
•
    Bluetooth
•
Accelerometer
• ADXL330 3-Axis ±3g iMEMS®
  Accelerometer
Accelerometer
                Y (-3G,3G)




        Z (-3G, 3G)
Accelerometer
                       0
Stil


                           0


                1
Accelerometer
                         0
Omhoog


                             0


                  >1
Accelerometer
                         0
Omlaag


                             0


                  <1
IR-camera
• PixArt optical sensor
  Multi-Object Tracking engine (MOT
  sensor™)
• Sensor bar
IR-camera
Bluetooth
• BCM2042
  Advanced Wireless Keyboard/Mouse
  Bluetooth® Chip
• HID Device
Wiimote -> PC
• OS
• Bluetooth Device
• Bluetooth stack
API’s
                                wiimote-api
  RMX Automation

                                   GlovePIE
       WiimoteLib
WiinRemote
                libwiimote       WMD Wiiewer

             WiimoteCPP
 WiiYourself!                Wiimotecomm
WiimoteLib classes
Simplicity
Demo time!
• Flying with the Wii

Más contenido relacionado

Destacado (12)

Make MarcEdit Work For You: OLC Technical Services Retreat
Make MarcEdit Work For You: OLC Technical Services RetreatMake MarcEdit Work For You: OLC Technical Services Retreat
Make MarcEdit Work For You: OLC Technical Services Retreat
 
Cloud Technology: Virtualization
Cloud Technology: VirtualizationCloud Technology: Virtualization
Cloud Technology: Virtualization
 
εξ αποστάσεως εκπαίδευση Revit structure
εξ αποστάσεως  εκπαίδευση Revit structureεξ αποστάσεως  εκπαίδευση Revit structure
εξ αποστάσεως εκπαίδευση Revit structure
 
Idei principale A Touch of Innovation 2015
Idei principale A Touch of Innovation 2015Idei principale A Touch of Innovation 2015
Idei principale A Touch of Innovation 2015
 
Critiques
CritiquesCritiques
Critiques
 
AIDS-affected MSEs
AIDS-affected MSEsAIDS-affected MSEs
AIDS-affected MSEs
 
DUPLICO
DUPLICODUPLICO
DUPLICO
 
The Future Of Giving: Why Students And Young Alumni Matter
The Future Of Giving: Why Students And Young Alumni MatterThe Future Of Giving: Why Students And Young Alumni Matter
The Future Of Giving: Why Students And Young Alumni Matter
 
Basvuru formu1
Basvuru formu1Basvuru formu1
Basvuru formu1
 
El proceso tecnologico
El proceso tecnologicoEl proceso tecnologico
El proceso tecnologico
 
genderlens
genderlensgenderlens
genderlens
 
2041_2
2041_22041_2
2041_2
 

Similar a XNA Intro Workshop

Leveraging Microsoft Embedded and Mobile Platforms
Leveraging Microsoft Embedded and Mobile PlatformsLeveraging Microsoft Embedded and Mobile Platforms
Leveraging Microsoft Embedded and Mobile Platformschristopherfairbairn
 
Design your 3d game engine
Design your 3d game engineDesign your 3d game engine
Design your 3d game engineDaosheng Mu
 
Writing Games in .NET with XNA Game Studio
Writing Games in .NET with XNA Game StudioWriting Games in .NET with XNA Game Studio
Writing Games in .NET with XNA Game StudioTim Thomas
 
งานPowerpoint ลูกศร1
งานPowerpoint ลูกศร1งานPowerpoint ลูกศร1
งานPowerpoint ลูกศร1amphaiboon
 
งานPowerpoint ลูกศร1
งานPowerpoint ลูกศร1งานPowerpoint ลูกศร1
งานPowerpoint ลูกศร1amphaiboon
 
ArcReady - Architecting For The Client Tier
ArcReady - Architecting For The Client TierArcReady - Architecting For The Client Tier
ArcReady - Architecting For The Client TierMicrosoft ArcReady
 
เทคโนโลยีสารสนเทศสำหรับครู
เทคโนโลยีสารสนเทศสำหรับครูเทคโนโลยีสารสนเทศสำหรับครู
เทคโนโลยีสารสนเทศสำหรับครูBeauso English
 
Desenvolvimento de Jogos em XNA para Windows Phone 7
Desenvolvimento de Jogos em XNA para Windows Phone 7Desenvolvimento de Jogos em XNA para Windows Phone 7
Desenvolvimento de Jogos em XNA para Windows Phone 7Comunidade NetPonto
 
Abc of DirectX
Abc of DirectXAbc of DirectX
Abc of DirectXPrabodh20
 
Writing Games in .NET with XNA Game Studio
Writing Games in .NET with XNA Game StudioWriting Games in .NET with XNA Game Studio
Writing Games in .NET with XNA Game StudioTim Thomas
 
Computer Components
Computer ComponentsComputer Components
Computer ComponentsBeth Sockman
 
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!David Isbitski
 
Game software development trends presentation
Game software development trends   presentationGame software development trends   presentation
Game software development trends presentation_veronika_
 
Casual Engines 2009
Casual Engines 2009Casual Engines 2009
Casual Engines 2009David Fox
 
Criando jogos para o windows 8
Criando jogos para o windows 8Criando jogos para o windows 8
Criando jogos para o windows 8José Farias
 

Similar a XNA Intro Workshop (20)

Xna game development
Xna game developmentXna game development
Xna game development
 
Xna Demo.Ppt
Xna Demo.PptXna Demo.Ppt
Xna Demo.Ppt
 
Leveraging Microsoft Embedded and Mobile Platforms
Leveraging Microsoft Embedded and Mobile PlatformsLeveraging Microsoft Embedded and Mobile Platforms
Leveraging Microsoft Embedded and Mobile Platforms
 
Xna
XnaXna
Xna
 
Design your 3d game engine
Design your 3d game engineDesign your 3d game engine
Design your 3d game engine
 
Writing Games in .NET with XNA Game Studio
Writing Games in .NET with XNA Game StudioWriting Games in .NET with XNA Game Studio
Writing Games in .NET with XNA Game Studio
 
งานPowerpoint ลูกศร1
งานPowerpoint ลูกศร1งานPowerpoint ลูกศร1
งานPowerpoint ลูกศร1
 
งานPowerpoint ลูกศร1
งานPowerpoint ลูกศร1งานPowerpoint ลูกศร1
งานPowerpoint ลูกศร1
 
ArcReady - Architecting For The Client Tier
ArcReady - Architecting For The Client TierArcReady - Architecting For The Client Tier
ArcReady - Architecting For The Client Tier
 
เทคโนโลยีสารสนเทศสำหรับครู
เทคโนโลยีสารสนเทศสำหรับครูเทคโนโลยีสารสนเทศสำหรับครู
เทคโนโลยีสารสนเทศสำหรับครู
 
Desenvolvimento de Jogos em XNA para Windows Phone 7
Desenvolvimento de Jogos em XNA para Windows Phone 7Desenvolvimento de Jogos em XNA para Windows Phone 7
Desenvolvimento de Jogos em XNA para Windows Phone 7
 
Abc of DirectX
Abc of DirectXAbc of DirectX
Abc of DirectX
 
Writing Games in .NET with XNA Game Studio
Writing Games in .NET with XNA Game StudioWriting Games in .NET with XNA Game Studio
Writing Games in .NET with XNA Game Studio
 
Computer Components
Computer ComponentsComputer Components
Computer Components
 
Introducing Windows Runtime in Windows 8
Introducing Windows Runtime in Windows 8Introducing Windows Runtime in Windows 8
Introducing Windows Runtime in Windows 8
 
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
Living the Dream: Make the Video Game You’ve Always Wanted and Get Paid For It!
 
Xna
XnaXna
Xna
 
Game software development trends presentation
Game software development trends   presentationGame software development trends   presentation
Game software development trends presentation
 
Casual Engines 2009
Casual Engines 2009Casual Engines 2009
Casual Engines 2009
 
Criando jogos para o windows 8
Criando jogos para o windows 8Criando jogos para o windows 8
Criando jogos para o windows 8
 

Último

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Último (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

XNA Intro Workshop

  • 1. Microsoft’s XNA Sjors Miltenburg Software Ontwikkelaar smiltenburg@sogyo.nl www.software-innovators.nl
  • 14. Call of Duty 4, 2007
  • 15. Facts USA [2007] $ 17.9 billion NL game industry bigger than film industry
  • 17. XNA • tools for game development • Completely managed environment • All aspects of game production in one system • Game development is accessible
  • 18. XNA Platform • XNA Framework • XNA Build • XNA Framework Content Pipeline • XNA Game Studio
  • 19. What do you need? .NET 3.0 • Visual Studio (C# Express is free!) • XNA Framework • XNA Game Studio •
  • 20. XNA Framework • Microsoft .NET CLR 3.0 (3.5?) • Cross-Platform Game Development – Windows XP – Windows Vista – Xbox 360  – Zune
  • 21. XNA Framework overview Games Code Content Components Starter Kits Extended Application Model Content Pipeline Framework Core Graphics Audio Input Math Storage Framework Platform XACT XINPUT XContent Direct3D Legend Community XNA Provides You Provide
  • 22. XNA Framework overview Games Code Content Components Starter Kits Extended Application Model Content Pipeline Framework Core Graphics Audio Input Math Storage Framework Platform XACT XINPUT XContent Direct3D Legend Community XNA Provides You Provide
  • 23. Starter Kits “Take our games and make them your own” • “Complete” games Starting point for your own games – Available through “New Project…” – Hit F5 and done! – Documentation and tutorials –
  • 24. Components • They use the standard gameloop – Initialize, Load, Update, Draw, Unload Create and re-use functionality • Use 3rd party components • Community has a standard • Menus, virtual keyboard, game engine, • game info, radar’s, map, etc…
  • 25. Components • Example of a Component – Virtual keyboard voor de XBOX 360
  • 26. XNA Framework overview Games Code Content Components Starter Kits Extended Application Model Content Pipeline Framework Core Graphics Audio Input Math Storage Framework Platform XACT XINPUT XContent Direct3D Legend Community XNA Provides You Provide
  • 27. Application Model • Platform abstraction – Don’t worry about the platform • First line of code is for your game • Game class – Starting point for your game
  • 28. Application Model Game Class, starting point • Game – Initialize – LoadContent – Update – Draw – UnloadContent • GameComponent, DrawableGameComponent
  • 29. Content Pipeline extensible content processing framework • 2D File Formats (.DDS, .BMP, .JPG, .PNG, .TGA) • 3D File Formats (.FBX, .X) • Material File Formats (.FX) • Audio File Formats (.XAP) •
  • 30. XNA Framework overview Games Code Content Components Starter Kits Extended Application Model Content Pipeline Framework Core Graphics Audio Input Math Storage Framework Platform XACT XINPUT XContent Direct3D Legend Community XNA Provides You Provide
  • 31. Core Framework • Graphics – SpriteBatch, BasicEffect, Texture2d, GraphicsDevice, Model, VertexBuffer • Audio – SoundBank, WaveBank, Cue, AudioEngine – Looping, Streaming en memory management – low-level buffer management • Input – GamePad, Keyboard, Mouse
  • 32. Core Framework • Math – MathHelper.ToRadians(float angle), PiOver4 • Storage – Title Storage (Shaders, Meshes, Textures, Sounds…) – User Storage (Save games, Scores…) – Emulated on the Windows Platform • Network – NetworkSession, PacketReader, NetworkGamer
  • 33. XNA Framework Overzicht Games Code Content Components Starter Kits Extended Application Model Content Pipeline Framework Core Graphics Audio Input Math Storage Framework Platform XACT XINPUT XContent Direct3D Legend Community XNA Provides You Provide
  • 34. Platform abstraction • Don’t worry about the platform, but about your game! • Mono started an implementation
  • 35. XACT • Microsoft Cross-Platform Audio Creation Tool • Create audio files for XNA games • Compiles .wav files • Add info to the sound – Looping, volume levels
  • 36. Community • 3D Models – Cars, Houses, humans, levels • Mostly free • http://turbosquid.com/xna
  • 37. Community • Example of a community built Component – XNA Console
  • 38. Deployment to Xbox 360 • What do you need to deploy to Xbox 360? – Xbox Live Account – XNA Game Launcher – Connection to computer – XNA Creators Club account • XNA Creators Club account – 49 euro (4 months) – 99 euro (1 year)
  • 39. Getting creative • Creating games with XNA is easy!
  • 40. We will be building • Tank game – Drive, aim and shoot
  • 41. Steps Run an empty game • Load graphical content • Show tank on screen • Handle user input • – Rotate – Move – Shoot
  • 42. Step 1: Empty game • Create a new XNA game • Run!
  • 43. Step 2: Load Content • Create a Tank Class – Vector2 (x,y) for position – Float (Radians) for direction • 3 resources (tank, turret, canonball) • Texture2D – ContentManager.Load<2DTexture>(“Tank”);
  • 44. Step 3.1: Display content • Draw tank • Draw turret • Draw @ center of the screen • Does it matter what you draw first?
  • 45. Step 3.2: Display content • SpriteBatch.Begin(); • SpriteBatch.Draw(7 implementations); • SpriteBatch.End(); • Screen – GraphicsManager.GraphicsDevice.Viewport – 0,0 = top left corner – 800,600 = bottom right corner
  • 46. Step 4: Handle User input • KeyboardState = Keyboard.GetState(); • If (KeyboardState.isKeyDown(Keys.Up)); • Where do we place this code? • Rotate (Tank & turret) • Move • Vector2 Movement = new Vector2(); • Movement.X += moveDist * (float)Math.Cos(Rotation); • Movement.Y += moveDist * (float)Math.Sin(Rotation);
  • 47. Step 5: Shoot • CannonBall Class • One shot at a time (space invader style)
  • 48. Step 6: Shoot Enemy • Draw stationary tank • Hit? – Rectangle.Intersects – Advanced: Per pixel collision – Where should this code go? • Draw tank health – Add new SpriteFont to content folder – Load Content – SpriteBatch.DrawString();
  • 49. Step 7: Network code • Sample code – Search for “XNA Network Prediction” – Uses Microsoft Live • Create a local account
  • 50. Resources http://creators.xna.com/ • http://blogs.msdn.com/xna • http://www.turbosquid.com/xna • http://xbox360homebrew.com • http://www.riemers.net • http://www.xnadevelopment.com • Search for XNA at Google with Live Search •
  • 53. Wiimote Knoppen • Accelerometer • IR-camera • Buzzer • Leds • Bluetooth •
  • 54. Accelerometer • ADXL330 3-Axis ±3g iMEMS® Accelerometer
  • 55. Accelerometer Y (-3G,3G) Z (-3G, 3G)
  • 56. Accelerometer 0 Stil 0 1
  • 57. Accelerometer 0 Omhoog 0 >1
  • 58. Accelerometer 0 Omlaag 0 <1
  • 59. IR-camera • PixArt optical sensor Multi-Object Tracking engine (MOT sensor™) • Sensor bar
  • 61. Bluetooth • BCM2042 Advanced Wireless Keyboard/Mouse Bluetooth® Chip • HID Device
  • 62. Wiimote -> PC • OS • Bluetooth Device • Bluetooth stack
  • 63. API’s wiimote-api RMX Automation GlovePIE WiimoteLib WiinRemote libwiimote WMD Wiiewer WiimoteCPP WiiYourself! Wiimotecomm
  • 66. Demo time! • Flying with the Wii