SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
XNA-in-a-Day
  Introduction to XNA
         Game Studio
Ed Donahue

                                                                    I love my life because…
                                                                    I get to travel!


                                  @creepyed          creepyed.com

Academic Developer Evangelist     I love my job because…            I love my life because…
Mid-Atlantic Region
                                  I help people build cool          I have random dance parties!
(MD, DC, VA, WV, NC, SC)
                                  technology!
Developer & Platform Evangelism
(DPE)

                                  I love my job because…
                                  I get to share my passion for
                                  technology with students!
GETTING STARTED
The Tools You Need
• A computer
  – A decent card if you want graphics acceleration
• Windows
  – Windows 7 works well
• Visual Studio or Visual C#
  – Visual Studio 2010 Professional – available to
    students through DreamSpark
• XNA Game Studio
  – Current version – XNA Game Studio 4.0

              ed.donahue@microsoft.com | creepyed.com | @creepyed
What is DreamSpark?
o   DreamSpark provides free Microsoft software to verified
    students around the world for FREE!

Who is eligible for DreamSpark?
o   All part-time and full-time students are entitled to DreamSpark software


What software can they get from DreamSpark?
o   Visual Studio 2010 Professional, Expression Studio 4 Ultimate, Windows
    Server, SQL Server
o   Free appHub account for Windows Phone 7 Marketplace
o   One year free subscription to XNA Creators Club
o   90 days of free Pluralsight training
www.DreamSpark.com
    to register
Visual Studio
•   Integrated Development Environment
•   Main code window
•   Solution Explorer
•   Toolbars and menus




             ed.donahue@microsoft.com | creepyed.com | @creepyed
Creating a game
• Create new project
• Basic structure of game project
  – Initialize
  – LoadContent (and UnloadContent)
  – Update
  – Draw
• GraphicsDeviceManager
• SpriteBatch (we’ll revisit)

             ed.donahue@microsoft.com | creepyed.com | @creepyed
ACTUALLY CREATING
A GAME…
Adding Assets
• http://bit.ly/XNADayFiles
• Content – what is it
• Add content to project




           ed.donahue@microsoft.com | creepyed.com | @creepyed
Preparing Assets (Background)

•   Texture2D
•   ContentManager
•   Content.Load
•   viewPortRect




            ed.donahue@microsoft.com | creepyed.com | @creepyed
Using Assets
• Draw() method
• 2D graphical assets - SpriteBatch




            ed.donahue@microsoft.com | creepyed.com | @creepyed
Now for some fun stuff
• Cannon
  – Loaded in the same way
  – Drawn in the same way
  – Not quite!




            ed.donahue@microsoft.com | creepyed.com | @creepyed
GameObject Class
• Sprite Texture
• Position
  – Vector2.Zero
• Center
• Rotation
  – Float




             ed.donahue@microsoft.com | creepyed.com | @creepyed
Cannon Take 2
• Declare
• Load
  – and set position
• Draw
  – Using GameObject properties
     …
• Interact


             ed.donahue@microsoft.com | creepyed.com | @creepyed
INTERACTION
Interaction Part 1
• Cannon Rotation
  – Shorthand operator +=
  – Thumbstick
  – Restricting movement

• Keyboard control too
  – Conditional compilation #if

• Change Draw method

             ed.donahue@microsoft.com | creepyed.com | @creepyed
Cannonballs - setup
• GameObject updates
  – Velocity
  – Alive
• Constants and Arrays
• Loops
  – for
  – foreach and condition to draw



               ed.donahue@microsoft.com | creepyed.com | @creepyed
Interaction Part 2
• State – GamePad and Keyboard
  – Define objects
  – Retrieve and save state




             ed.donahue@microsoft.com | creepyed.com | @creepyed
Cannonballs - firing
• Buttons.A == ButtonState.Pressed
  – Previous state should be Released (make them
    work for it)
• Automatic Method creation
• Rotation in Radians – Cos/Sin math
  functions
• return to exit loop


            ed.donahue@microsoft.com | creepyed.com | @creepyed
Cannonballs - moving
• Position + Velocity
• Is it still visible?
  – viewPortRect.Contains(Point)




             ed.donahue@microsoft.com | creepyed.com | @creepyed
Something to shoot at (1)
• Same as cannonballs
  – Array Declaration
  – Load Content
  – Draw
  – Update if alive




             ed.donahue@microsoft.com | creepyed.com | @creepyed
Something to shoot at (2)
• Different from cannonballs
  – Update if not alive
  – Set Velocity
  – Set Position
  – Set Alive




             ed.donahue@microsoft.com | creepyed.com | @creepyed
Introducing randomness
• Random
• Random.NextDouble
• Lerp - MathHelper function
  – Interpolate number within range




            ed.donahue@microsoft.com | creepyed.com | @creepyed
Contact!
• Compare cannonballs and enemies
• Create virtual Rectangles
• Check Intersect




           ed.donahue@microsoft.com | creepyed.com | @creepyed
Scoring - SpriteFont
•   Create
•   Declare
•   Load
•   Draw




              ed.donahue@microsoft.com | creepyed.com | @creepyed
WHERE TO NEXT?
Particle System
• Use
  – 2D textures
  – Randomness
  – Rotation, velocity, position




             ed.donahue@microsoft.com | creepyed.com | @creepyed
Imagine Cup

VIDEOS!



ed.donahue@microsoft.com | creepyed.com | @creepyed
Windows Phone 7
• Converting to Windows Phone 7 (or Xbox
  360).
• Add touch support
• Take it to the next level




           ed.donahue@microsoft.com | creepyed.com | @creepyed
Windows Phone 7 - Touch
• Add Reference

• Get TouchPanel state

• Check TouchLocation state




           ed.donahue@microsoft.com | creepyed.com | @creepyed
Starter Kits
•   Platformer
•   RPG
•   Space Shooter
•   Racing




             ed.donahue@microsoft.com | creepyed.com | @creepyed
ScriptTD
• Tower defense game engine
• Customizable images and audio
• scriptTD.codeplex.com




           ed.donahue@microsoft.com | creepyed.com | @creepyed

Contenu connexe

En vedette

Neobird developer profile 2014
Neobird developer profile 2014Neobird developer profile 2014
Neobird developer profile 2014Florian Brich
 
Poly Game Studio Brochure
Poly Game Studio BrochurePoly Game Studio Brochure
Poly Game Studio BrochureBigyan Kar
 
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...Jayneel Patel
 
Riot Games' Insights Evolution
Riot Games' Insights EvolutionRiot Games' Insights Evolution
Riot Games' Insights Evolutionbhsiung
 
Ideaworks Game Studio Profile
Ideaworks Game Studio ProfileIdeaworks Game Studio Profile
Ideaworks Game Studio Profilerobhendry
 

En vedette (9)

Neobird developer profile 2014
Neobird developer profile 2014Neobird developer profile 2014
Neobird developer profile 2014
 
Poly Game Studio Brochure
Poly Game Studio BrochurePoly Game Studio Brochure
Poly Game Studio Brochure
 
Casual Connect Europe 2014
Casual Connect Europe 2014Casual Connect Europe 2014
Casual Connect Europe 2014
 
Star Art Portfolio
Star Art PortfolioStar Art Portfolio
Star Art Portfolio
 
Game and studio review
Game and studio reviewGame and studio review
Game and studio review
 
Sistema Genital Masculino Parte I
Sistema Genital Masculino Parte ISistema Genital Masculino Parte I
Sistema Genital Masculino Parte I
 
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...
OpenXcell Studio Webinar: From Concept to Development - How Does Mobile Game ...
 
Riot Games' Insights Evolution
Riot Games' Insights EvolutionRiot Games' Insights Evolution
Riot Games' Insights Evolution
 
Ideaworks Game Studio Profile
Ideaworks Game Studio ProfileIdeaworks Game Studio Profile
Ideaworks Game Studio Profile
 

Plus de Ed Donahue

AT&T Hackathon Hawaii
AT&T Hackathon HawaiiAT&T Hackathon Hawaii
AT&T Hackathon HawaiiEd Donahue
 
AT&T Hack-o-ween
AT&T Hack-o-weenAT&T Hack-o-ween
AT&T Hack-o-weenEd Donahue
 
AT&T Government Hackathon, Washington DC. 10/6/2017
AT&T Government Hackathon, Washington DC. 10/6/2017AT&T Government Hackathon, Washington DC. 10/6/2017
AT&T Government Hackathon, Washington DC. 10/6/2017Ed Donahue
 
AT&T IoT Civic Hackathon @ IndyPy
AT&T IoT Civic Hackathon @ IndyPyAT&T IoT Civic Hackathon @ IndyPy
AT&T IoT Civic Hackathon @ IndyPyEd Donahue
 
AT&T VR/AR Hackathon - Seattle
AT&T VR/AR Hackathon - SeattleAT&T VR/AR Hackathon - Seattle
AT&T VR/AR Hackathon - SeattleEd Donahue
 
AT&T IoT Hackathon - Dallas (hosted by The DEC)
AT&T IoT Hackathon - Dallas (hosted by The DEC)AT&T IoT Hackathon - Dallas (hosted by The DEC)
AT&T IoT Hackathon - Dallas (hosted by The DEC)Ed Donahue
 
Cisco Lightning Talk
Cisco Lightning TalkCisco Lightning Talk
Cisco Lightning TalkEd Donahue
 
Intel Lightning Talk
Intel Lightning TalkIntel Lightning Talk
Intel Lightning TalkEd Donahue
 
IBM Lightning Talk
IBM Lightning TalkIBM Lightning Talk
IBM Lightning TalkEd Donahue
 
AT&T Public Sector Hackathon
AT&T Public Sector HackathonAT&T Public Sector Hackathon
AT&T Public Sector HackathonEd Donahue
 
AT&T IoT Hackathon - Seattle
AT&T IoT Hackathon - SeattleAT&T IoT Hackathon - Seattle
AT&T IoT Hackathon - SeattleEd Donahue
 
AT&T Shape Hackathon Kick-off
AT&T Shape Hackathon Kick-offAT&T Shape Hackathon Kick-off
AT&T Shape Hackathon Kick-offEd Donahue
 
BIAC Hackathon Kick-off
BIAC Hackathon Kick-offBIAC Hackathon Kick-off
BIAC Hackathon Kick-offEd Donahue
 
BIAC Hackathon Lightning Talks
BIAC Hackathon Lightning TalksBIAC Hackathon Lightning Talks
BIAC Hackathon Lightning TalksEd Donahue
 
AT&T Smart Cities Hackathon
AT&T Smart Cities HackathonAT&T Smart Cities Hackathon
AT&T Smart Cities HackathonEd Donahue
 
AT&T Mobile App & IoT Hackathon @ Catalyst
AT&T Mobile App & IoT Hackathon @ Catalyst AT&T Mobile App & IoT Hackathon @ Catalyst
AT&T Mobile App & IoT Hackathon @ Catalyst Ed Donahue
 
AT&T Mobile App Hackathon (Smart City) - Berkeley
AT&T Mobile App Hackathon (Smart City) - BerkeleyAT&T Mobile App Hackathon (Smart City) - Berkeley
AT&T Mobile App Hackathon (Smart City) - BerkeleyEd Donahue
 
AT&T Mobile App Hackathon - Seattle
AT&T Mobile App Hackathon - SeattleAT&T Mobile App Hackathon - Seattle
AT&T Mobile App Hackathon - SeattleEd Donahue
 
Malvern WOWZAPP Info
Malvern WOWZAPP InfoMalvern WOWZAPP Info
Malvern WOWZAPP InfoEd Donahue
 
Windows 8 Contracts
Windows 8 ContractsWindows 8 Contracts
Windows 8 ContractsEd Donahue
 

Plus de Ed Donahue (20)

AT&T Hackathon Hawaii
AT&T Hackathon HawaiiAT&T Hackathon Hawaii
AT&T Hackathon Hawaii
 
AT&T Hack-o-ween
AT&T Hack-o-weenAT&T Hack-o-ween
AT&T Hack-o-ween
 
AT&T Government Hackathon, Washington DC. 10/6/2017
AT&T Government Hackathon, Washington DC. 10/6/2017AT&T Government Hackathon, Washington DC. 10/6/2017
AT&T Government Hackathon, Washington DC. 10/6/2017
 
AT&T IoT Civic Hackathon @ IndyPy
AT&T IoT Civic Hackathon @ IndyPyAT&T IoT Civic Hackathon @ IndyPy
AT&T IoT Civic Hackathon @ IndyPy
 
AT&T VR/AR Hackathon - Seattle
AT&T VR/AR Hackathon - SeattleAT&T VR/AR Hackathon - Seattle
AT&T VR/AR Hackathon - Seattle
 
AT&T IoT Hackathon - Dallas (hosted by The DEC)
AT&T IoT Hackathon - Dallas (hosted by The DEC)AT&T IoT Hackathon - Dallas (hosted by The DEC)
AT&T IoT Hackathon - Dallas (hosted by The DEC)
 
Cisco Lightning Talk
Cisco Lightning TalkCisco Lightning Talk
Cisco Lightning Talk
 
Intel Lightning Talk
Intel Lightning TalkIntel Lightning Talk
Intel Lightning Talk
 
IBM Lightning Talk
IBM Lightning TalkIBM Lightning Talk
IBM Lightning Talk
 
AT&T Public Sector Hackathon
AT&T Public Sector HackathonAT&T Public Sector Hackathon
AT&T Public Sector Hackathon
 
AT&T IoT Hackathon - Seattle
AT&T IoT Hackathon - SeattleAT&T IoT Hackathon - Seattle
AT&T IoT Hackathon - Seattle
 
AT&T Shape Hackathon Kick-off
AT&T Shape Hackathon Kick-offAT&T Shape Hackathon Kick-off
AT&T Shape Hackathon Kick-off
 
BIAC Hackathon Kick-off
BIAC Hackathon Kick-offBIAC Hackathon Kick-off
BIAC Hackathon Kick-off
 
BIAC Hackathon Lightning Talks
BIAC Hackathon Lightning TalksBIAC Hackathon Lightning Talks
BIAC Hackathon Lightning Talks
 
AT&T Smart Cities Hackathon
AT&T Smart Cities HackathonAT&T Smart Cities Hackathon
AT&T Smart Cities Hackathon
 
AT&T Mobile App & IoT Hackathon @ Catalyst
AT&T Mobile App & IoT Hackathon @ Catalyst AT&T Mobile App & IoT Hackathon @ Catalyst
AT&T Mobile App & IoT Hackathon @ Catalyst
 
AT&T Mobile App Hackathon (Smart City) - Berkeley
AT&T Mobile App Hackathon (Smart City) - BerkeleyAT&T Mobile App Hackathon (Smart City) - Berkeley
AT&T Mobile App Hackathon (Smart City) - Berkeley
 
AT&T Mobile App Hackathon - Seattle
AT&T Mobile App Hackathon - SeattleAT&T Mobile App Hackathon - Seattle
AT&T Mobile App Hackathon - Seattle
 
Malvern WOWZAPP Info
Malvern WOWZAPP InfoMalvern WOWZAPP Info
Malvern WOWZAPP Info
 
Windows 8 Contracts
Windows 8 ContractsWindows 8 Contracts
Windows 8 Contracts
 

Dernier

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

XNA-in-a-Day

  • 1. XNA-in-a-Day Introduction to XNA Game Studio
  • 2. Ed Donahue I love my life because… I get to travel! @creepyed creepyed.com Academic Developer Evangelist I love my job because… I love my life because… Mid-Atlantic Region I help people build cool I have random dance parties! (MD, DC, VA, WV, NC, SC) technology! Developer & Platform Evangelism (DPE) I love my job because… I get to share my passion for technology with students!
  • 4. The Tools You Need • A computer – A decent card if you want graphics acceleration • Windows – Windows 7 works well • Visual Studio or Visual C# – Visual Studio 2010 Professional – available to students through DreamSpark • XNA Game Studio – Current version – XNA Game Studio 4.0 ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 5.
  • 6. What is DreamSpark? o DreamSpark provides free Microsoft software to verified students around the world for FREE! Who is eligible for DreamSpark? o All part-time and full-time students are entitled to DreamSpark software What software can they get from DreamSpark? o Visual Studio 2010 Professional, Expression Studio 4 Ultimate, Windows Server, SQL Server o Free appHub account for Windows Phone 7 Marketplace o One year free subscription to XNA Creators Club o 90 days of free Pluralsight training
  • 7. www.DreamSpark.com to register
  • 8. Visual Studio • Integrated Development Environment • Main code window • Solution Explorer • Toolbars and menus ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 9. Creating a game • Create new project • Basic structure of game project – Initialize – LoadContent (and UnloadContent) – Update – Draw • GraphicsDeviceManager • SpriteBatch (we’ll revisit) ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 11. Adding Assets • http://bit.ly/XNADayFiles • Content – what is it • Add content to project ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 12. Preparing Assets (Background) • Texture2D • ContentManager • Content.Load • viewPortRect ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 13. Using Assets • Draw() method • 2D graphical assets - SpriteBatch ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 14. Now for some fun stuff • Cannon – Loaded in the same way – Drawn in the same way – Not quite! ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 15. GameObject Class • Sprite Texture • Position – Vector2.Zero • Center • Rotation – Float ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 16. Cannon Take 2 • Declare • Load – and set position • Draw – Using GameObject properties … • Interact ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 18. Interaction Part 1 • Cannon Rotation – Shorthand operator += – Thumbstick – Restricting movement • Keyboard control too – Conditional compilation #if • Change Draw method ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 19. Cannonballs - setup • GameObject updates – Velocity – Alive • Constants and Arrays • Loops – for – foreach and condition to draw ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 20. Interaction Part 2 • State – GamePad and Keyboard – Define objects – Retrieve and save state ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 21. Cannonballs - firing • Buttons.A == ButtonState.Pressed – Previous state should be Released (make them work for it) • Automatic Method creation • Rotation in Radians – Cos/Sin math functions • return to exit loop ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 22. Cannonballs - moving • Position + Velocity • Is it still visible? – viewPortRect.Contains(Point) ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 23. Something to shoot at (1) • Same as cannonballs – Array Declaration – Load Content – Draw – Update if alive ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 24. Something to shoot at (2) • Different from cannonballs – Update if not alive – Set Velocity – Set Position – Set Alive ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 25. Introducing randomness • Random • Random.NextDouble • Lerp - MathHelper function – Interpolate number within range ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 26. Contact! • Compare cannonballs and enemies • Create virtual Rectangles • Check Intersect ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 27. Scoring - SpriteFont • Create • Declare • Load • Draw ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 29. Particle System • Use – 2D textures – Randomness – Rotation, velocity, position ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 31. Windows Phone 7 • Converting to Windows Phone 7 (or Xbox 360). • Add touch support • Take it to the next level ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 32. Windows Phone 7 - Touch • Add Reference • Get TouchPanel state • Check TouchLocation state ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 33. Starter Kits • Platformer • RPG • Space Shooter • Racing ed.donahue@microsoft.com | creepyed.com | @creepyed
  • 34. ScriptTD • Tower defense game engine • Customizable images and audio • scriptTD.codeplex.com ed.donahue@microsoft.com | creepyed.com | @creepyed