Blog: http://blog.syntaxc4.net<br />
Learning Objectives<br />Why Windows Phone 7?<br />What is XNA?<br />XNA Game Programming Basics<br />Dream. Build. Play.<...
Why Windows Phone 7?<br />
What is XNA?<br />** Disclaimer: Items are not to scale.<br />
The Basics<br />“<br />Focus on gameplay! There's no point in having the latest, greatest tech in a game if the gameplay i...
The Game Loop<br />Initialize()<br />LoadContent()<br />The Loop<br />Update()<br />Draw()<br />UnloadContent()<br />
Demo #1: Stepping into the Game Loop<br />
Textures<br />
Sprites<br />
Demo #2:Adding Textures and Sprites<br />
Sensors<br />using Microsoft.Devices.Sensors;<br />AccelerometerReadingEventArgs accelState;Accelerometer _accelerometer =...
Input<br />TouchCollection touchState = TouchPanel.GetState();<br /> //interpret touch screen pressesforeach (TouchLocatio...
Tombstoning<br />For games, when the Back button is pressed during gameplay, the game can choose to present a pause contex...
Dream. Build. Play.<br />
Dream<br />
The Idea<br />
It could be new…<br />
…Or a new Twist<br />
We’re going to borrow an Idea<br />
Build<br />
Alien Game Lab<br />Three Pillars of Game Development<br />Prototype<br />Performance<br />Polish<br />URL:  http://hmbl.m...
Prototyping<br />
Architecture<br />Connected<br />
Architecture<br />Disconnected<br />
Game State Management<br />URL:  http://hmbl.me/4BSHGB<br />
Demo #4:Creating a Screen<br />
Performance&Code Quality<br />
Enums are Handy<br />
Avoid Boxing<br />Use Generics<br />
Array vs List<br />
struct vs class<br />
Trial Mode<br />An application must not invoke either of the Trial APIs in a tight loop. For example, a game application m...
Demo #5:Trial Mode<br />
Polishing<br />
Game Feedback<br />using Microsoft.Devices;<br />VibrateController.Default.Start(<br />TimeSpan.FromSeconds(1));<br />
Game Feedback<br />This requirement does not apply to applications that play sound effects through the Microsoft.Xna.Frame...
Play<br />
Side Load<br />
Market Place<br />http://create.msdn.com<br />
Next Steps…<br />
Q & A<br />Sorry, I don’t give out Game Ideas<br />
Upcoming SlideShare
Loading in …5
×

XNA On Windows Phone 7

2,280 views

Published on

Learn how to develop XNA Games for Windows Phone 7

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

  • Be the first to like this

No Downloads
Views
Total views
2,280
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
34
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Welcome out to the Windows Phone Developer Briefing:[Intro]- Cory Fowler- ObjectSharp- Games Hobbyist
  • Consumer facing PhoneXbox Live IntegrationFamiliar Development StorySilverlightXNAC# or VB.NET
  • Brings Managed Code to Games DevelopmentCross Platform Development between ZuneWindows PhoneXbox360Windows 7All on One Code Base
  • The XNA Framework like most games runs on a Game LoopInitialization ConstructorLoadContentLoad up main graphics required for gameplayThe LoopUpdateUser input Collection and Calculation of Sprite PositioningDrawRe-Draw the sprites on the ScreenUnloadContentGarbage Collection and Freeing up resources
  • Open Visual StudioCreate new Game ProjectReview Code Blocks for The Loop
  • Image files which are loaded into a game.There is a good chance that your game with be someone in the ballpark of 60-70% Textures.Your game can only take up 90MB of RAM while running.
  • Sprites are images that move independently to the rest of the game.A Sprites position and other attributes are maintained in a instance of a class or struct.
  • Add in two Textures and load them onto the screen with SpriteBatch.Draw
  • Currently the only Sensor supported by the Phones APIs is the Accelerometer.
  • Make sure that your Architecture is part of your prototype.Plan for when the phone is Connected…
  • Plan for when the Phone is Disconnected…
  • Knowing the Architecture Story of your Game will aid you in Laying out the Flow of your Screens.You can also find the Game State Management Project Template in the Extension Manager.
  • Open AlienGame [Start Here] and create Pause ScreenInherit MenuScreenCreate MenuEntry for ResumeCreate MenuEntry for QuitAdd to MenuEntries Collection
  • Enums are great for tracking state, which in a game there is a LOT of state.Enumsalso help make your code easier to ready, which allows you to use your brainpower for the Math.Smaller Operating cost than using Strings.
  • Boxing is a processing intense operation.
  • Arrays – Memory Allocation is going to be consistentList – Basically any hand rolled POCOAvoid - boxed
  • structs are optimal for objects up to 16bytes in size and are good candidates for using arrays.Classes are a good choice if the size of the object is going to fluxuaterepetetively
  • The Typical response time of this method is 6 MillisecondsShould only be called during Initialize and Activated
  • XNA On Windows Phone 7

    1. 1. Blog: http://blog.syntaxc4.net<br />
    2. 2. Learning Objectives<br />Why Windows Phone 7?<br />What is XNA?<br />XNA Game Programming Basics<br />Dream. Build. Play.<br />Next Steps…<br />“<br />The hardest thing about creating your first game is finishing it. – @OwenGoss<br />
    3. 3. Why Windows Phone 7?<br />
    4. 4. What is XNA?<br />** Disclaimer: Items are not to scale.<br />
    5. 5. The Basics<br />“<br />Focus on gameplay! There's no point in having the latest, greatest tech in a game if the gameplay is terrible. - @Justin_Hebert<br />
    6. 6. The Game Loop<br />Initialize()<br />LoadContent()<br />The Loop<br />Update()<br />Draw()<br />UnloadContent()<br />
    7. 7. Demo #1: Stepping into the Game Loop<br />
    8. 8. Textures<br />
    9. 9. Sprites<br />
    10. 10. Demo #2:Adding Textures and Sprites<br />
    11. 11. Sensors<br />using Microsoft.Devices.Sensors;<br />AccelerometerReadingEventArgs accelState;Accelerometer _accelerometer = new Accelerometer();if (_accelerometer.State == SensorState.Ready){    _accelerometer.ReadingChanged += (s, e) =>    {           accelState = e;    };    _accelerometer.Start();}<br />
    12. 12. Input<br />TouchCollection touchState = TouchPanel.GetState();<br /> //interpret touch screen pressesforeach (TouchLocation location in touchState){     switch (location.State)     {        case TouchLocationState.Pressed:             buttonTouched = true;             break;        case TouchLocationState.Moved:             break;        case TouchLocationState.Released:             break;    }} <br />
    13. 13. Tombstoning<br />For games, when the Back button is pressed during gameplay, the game can choose to present a pause context menu or dialog or navigate the user to the prior menu screen. Pressing the Back button again while in a paused context menu or dialog closes the menu or dialog.<br />
    14. 14. Dream. Build. Play.<br />
    15. 15. Dream<br />
    16. 16. The Idea<br />
    17. 17. It could be new…<br />
    18. 18. …Or a new Twist<br />
    19. 19. We’re going to borrow an Idea<br />
    20. 20. Build<br />
    21. 21. Alien Game Lab<br />Three Pillars of Game Development<br />Prototype<br />Performance<br />Polish<br />URL: http://hmbl.me/4BSBKO<br />
    22. 22. Prototyping<br />
    23. 23. Architecture<br />Connected<br />
    24. 24. Architecture<br />Disconnected<br />
    25. 25. Game State Management<br />URL: http://hmbl.me/4BSHGB<br />
    26. 26. Demo #4:Creating a Screen<br />
    27. 27. Performance&Code Quality<br />
    28. 28. Enums are Handy<br />
    29. 29. Avoid Boxing<br />Use Generics<br />
    30. 30. Array vs List<br />
    31. 31. struct vs class<br />
    32. 32. Trial Mode<br />An application must not invoke either of the Trial APIs in a tight loop. For example, a game application must not invoke either of the Trial APIs while in a game loop. The API should be called infrequently and the value returned should be cached <br />bool isTrial = Guide.IsTrialMode;<br />
    33. 33. Demo #5:Trial Mode<br />
    34. 34. Polishing<br />
    35. 35. Game Feedback<br />using Microsoft.Devices;<br />VibrateController.Default.Start(<br />TimeSpan.FromSeconds(1));<br />
    36. 36. Game Feedback<br />This requirement does not apply to applications that play sound effects through the Microsoft.Xna.Framework.Audio.SoundEffect class, as sound effects will be mixed with the MediaPlayer. The SoundEffect class should not be used to play background music. <br />SoundEffect alienFired = <br /> Content.Load<SoundEffect>("Tank_Fire");alienFired.Play();<br />
    37. 37. Play<br />
    38. 38. Side Load<br />
    39. 39. Market Place<br />http://create.msdn.com<br />
    40. 40. Next Steps…<br />
    41. 41. Q & A<br />Sorry, I don’t give out Game Ideas<br />

    ×