• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
XNA in a Day
 

XNA in a Day

on

  • 1,145 views

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

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

Statistics

Views

Total Views
1,145
Views on SlideShare
1,139
Embed Views
6

Actions

Likes
0
Downloads
16
Comments
0

1 Embed 6

http://paper.li 6

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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 XNA in a Day Presentation Transcript

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