using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using Microsoft.Xna.Framework;<br />using Microsoft.Xna.Framework.Audio;<br />using Microsoft.Xna.Framework.Content;<br />using Microsoft.Xna.Framework.GamerServices;<br />using Microsoft.Xna.Framework.Graphics;<br />using Microsoft.Xna.Framework.Input;<br />using Microsoft.Xna.Framework.Media;<br />using Microsoft.Xna.Framework.Net;<br />using Microsoft.Xna.Framework.Storage;</p><p>namespace WindowsGame1<br />{<br /> /// <summary><br /> /// This is the main type for your game<br /> /// </summary><br /> public class Game1 : Microsoft.Xna.Framework.Game<br /> {<br /> GraphicsDeviceManager graphics;<br /> SpriteBatch spriteBatch;</p><p> public Game1()<br /> {<br /> graphics = new GraphicsDeviceManager(this);<br /> Content.RootDirectory = "Content";<br /> }</p><p> /// <summary><br /> /// Allows the game to perform any initialization it needs to before starting to run.<br /> /// This is where it can query for any required services and load any non-graphic<br /> /// related content. Calling base.Initialize will enumerate through any components<br /> /// and initialize them as well.<br /> /// </summary><br /> protected override void Initialize()<br /> {<br /> // TODO: Add your initialization logic here</p><p> base.Initialize();<br /> }</p><p> /// <summary><br /> /// LoadContent will be called once per game and is the place to load<br /> /// all of your content.<br /> /// </summary><br /> protected override void LoadContent()<br /> {<br /> // Create a new SpriteBatch, which can be used to draw textures.<br /> spriteBatch = new SpriteBatch(GraphicsDevice);</p><p> // TODO: use this.Content to load your game content here<br /> }</p><p> /// <summary><br /> /// UnloadContent will be called once per game and is the place to unload<br /> /// all content.<br /> /// </summary><br /> protected override void UnloadContent()<br /> {<br /> // TODO: Unload any non ContentManager content here<br /> }</p><p> /// <summary><br /> /// Allows the game to run logic such as updating the world,<br /> /// checking for collisions, gathering input, and playing audio.<br /> /// </summary><br /> /// <param name="gameTime">Provides a snapshot of timing values.</param><br /> protected override void Update(GameTime gameTime)<br /> {<br /> // Allows the game to exit<br /> if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)<br /> this.Exit();</p><p> // TODO: Add your update logic here</p><p> base.Update(gameTime);<br /> }</p><p> /// <summary><br /> /// This is called when the game should draw itself.<br /> /// </summary><br /> /// <param name="gameTime">Provides a snapshot of timing values.</param><br /> protected override void Draw(GameTime gameTime)<br /> {<br /> GraphicsDevice.Clear(Color.CornflowerBlue);</p><p> // TODO: Add your drawing code here</p><p> base.Draw(gameTime);<br /> }<br /> }<br />}<br />