XNA in a Day

1,292 views

Published on

Presentation deck to go along with my XNA in a Day training.

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,292
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Welcome!Who am I?Who is Karo?Who is DPE?
  • 5 minutes – finish around 8 minute mark 37m left
  • 5 minutes – finish around 8 minute mark 37m left
  • 5 minutes – finish around 8 minute mark 37m left
  • Clamp, MathHelper, -PiOver2, 0
  • XNA in a Day

    1. 1. XNA-in-a-Day Introduction to XNA Game Studio
    2. 2. Andrew ParsonsAcademic Developer Evangelist@MrAndyPuppy
    3. 3. GETTINGSTARTED
    4. 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
    5. 5. 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 softwareWhat software can they get from DreamSpark?o Visual Studio 2010 Professional, Expression Studio 4 Ultimate, Windows Server, SQL Servero Free appHub account for Windows Phone 7 Marketplaceo One year free subscription to XNA Creators Clubo 90 days of free Pluralsight training
    6. 6. www.DreamSpark.com to register
    7. 7. Visual Studio• Integrated Development Environment• Main code window• Solution Explorer• Toolbars and menus
    8. 8. Creating a game• Create new project• Basic structure of game project – Initialize – LoadContent (and UnloadContent) – Update – Draw• GraphicsDeviceManager• SpriteBatch (we’ll revisit)
    9. 9. ACTUALLYCREATING A
    10. 10. Adding Assets• http://bit.ly/XNADayFiles• Content – what is it• Add content to project
    11. 11. Preparing Assets (Background)• Texture2D• ContentManager• Content.Load• viewPortRect
    12. 12. Using Assets• Draw() method• 2D graphical assets - SpriteBatch
    13. 13. Now for some fun stuff• Cannon – Loaded in the same way – Drawn in the same way – Not quite!
    14. 14. GameObject Class• Sprite Texture• Position – Vector2.Zero• Center• Rotation – Float
    15. 15. Cannon Take 2• Declare• Load – and set position• Draw – Using GameObject properties …• Interact
    16. 16. INTERACTION
    17. 17. Interaction Part 1• Cannon Rotation – Shorthand operator += – Thumbstick – Restricting movement• Keyboard control too – Conditional compilation #if• Change Draw method
    18. 18. Cannonballs - setup• GameObject updates – Velocity – Alive• Constants and Arrays• Loops – for – foreach and condition to draw
    19. 19. Interaction Part 2• State – GamePad and Keyboard – Define objects – Retrieve and save state
    20. 20. 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
    21. 21. Cannonballs - moving• Position + Velocity• Is it still visible? – viewPortRect.Contains(Point)
    22. 22. Something to shoot at (1)• Same as cannonballs – Array Declaration – Load Content – Draw – Update if alive
    23. 23. Something to shoot at (2)• Different from cannonballs – Update if not alive – Set Velocity – Set Position – Set Alive
    24. 24. Introducing randomness• Random• Random.NextDouble• Lerp - MathHelper function – Interpolate number within range
    25. 25. Contact!• Compare cannonballs and enemies• Create virtual Rectangles• Check Intersect
    26. 26. Scoring - SpriteFont• Create• Declare• Load• Draw
    27. 27. WHERE TO NEXT?
    28. 28. Particle System• Use – 2D textures – Randomness – Rotation, velocity, position
    29. 29. Imagine CupVIDEOS!
    30. 30. Windows Phone 7• Converting to Windows Phone 7 (or Xbox 360).• Add touch support• Take it to the next level
    31. 31. Windows Phone 7 - Touch• Add Reference• Get TouchPanel state• Check TouchLocation state
    32. 32. Starter Kits• Platformer• RPG• Space Shooter• Racing
    33. 33. ScriptTD• http://bit.ly/APscriptTD
    34. 34. More Info• http://bit.ly/puppyblog• http://bit.ly/puppytube

    ×