Commits

Anonymous committed ee06705

First commit

Comments (0)

Files changed (13)

+syntax: glob
+*/obj/*
+*/bin/*
+tools/*
+*.user
+*.suo
+*/_ReSharper*/
+src/packages/*
+*.docstates
+build/*
+StyleCop.Cache
+*.vs10x
+*.orig
+*.dotCover
+*.csproj.Debug.cachefile

AnimatedSpritesLab.sln

+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimatedSpritesLab", "AnimatedSpritesLab\AnimatedSpritesLab\AnimatedSpritesLab.csproj", "{7573BBF2-AA0F-4D53-856A-E7231D0EE136}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimatedSpritesLabContent", "AnimatedSpritesLab\AnimatedSpritesContentLab\AnimatedSpritesLabContent.contentproj", "{94862CFD-E1D9-414A-AB00-032651EDF9B8}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x86 = Debug|x86
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{7573BBF2-AA0F-4D53-856A-E7231D0EE136}.Debug|x86.ActiveCfg = Debug|x86
+		{7573BBF2-AA0F-4D53-856A-E7231D0EE136}.Debug|x86.Build.0 = Debug|x86
+		{7573BBF2-AA0F-4D53-856A-E7231D0EE136}.Release|x86.ActiveCfg = Release|x86
+		{7573BBF2-AA0F-4D53-856A-E7231D0EE136}.Release|x86.Build.0 = Release|x86
+		{94862CFD-E1D9-414A-AB00-032651EDF9B8}.Debug|x86.ActiveCfg = Debug|x86
+		{94862CFD-E1D9-414A-AB00-032651EDF9B8}.Release|x86.ActiveCfg = Release|x86
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

AnimatedSpritesLab/AnimatedSpritesContentLab/AnimatedSpritesLabContent.contentproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectGuid>{94862CFD-E1D9-414A-AB00-032651EDF9B8}</ProjectGuid>
+    <ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+    <OutputPath>bin\$(Platform)\$(Configuration)</OutputPath>
+    <ContentRootDirectory>Content</ContentRootDirectory>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup>
+    <RootNamespace>Lab4_AnimatedSpritesContent</RootNamespace>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="mario2.png">
+      <Name>mario2</Name>
+      <Importer>TextureImporter</Importer>
+      <Processor>TextureProcessor</Processor>
+      <ProcessorParameters_ColorKeyColor>0, 115, 0, 255</ProcessorParameters_ColorKeyColor>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="StoneBlock.png">
+      <Name>StoneBlock</Name>
+      <Importer>TextureImporter</Importer>
+      <Processor>TextureProcessor</Processor>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
+  <!--  To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

AnimatedSpritesLab/AnimatedSpritesContentLab/StoneBlock.png

Added
New image

AnimatedSpritesLab/AnimatedSpritesContentLab/mario2.png

Added
New image

AnimatedSpritesLab/AnimatedSpritesLab/AnimatedSprite.cs

+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace AnimatedSprites
+{
+	public class AnimatedSprite
+	{
+		private readonly int _framesAcross;
+		private readonly int _framesDown;
+		private readonly int _frameWidth;
+		private readonly int _frameHeight;
+		private readonly int _millisecondsPerFrame;
+		private readonly Texture2D _texture;
+		private int _currentFrameX;
+		private int _currentFrameY;
+		private int _timeSinceLastFrameChanged;
+
+		public AnimatedSprite(int framesAcross, int framesDown, int frameWidth, int frameHeight, int millisecondsPerFrame, Texture2D texture)
+		{
+			_framesAcross = framesAcross;
+			_framesDown = framesDown;
+			_frameWidth = frameWidth;
+			_frameHeight = frameHeight;
+			_millisecondsPerFrame = millisecondsPerFrame;
+			_texture = texture;
+		}
+
+		public Vector2 Position { get; set; }
+
+		public int FrameWidth
+		{
+			get { return _frameWidth; }
+		}
+
+		public int FrameHeight
+		{
+			get { return _frameHeight; }
+		}
+
+		public void Update(int elapsedTime)
+		{
+            // Todo:
+            // Complete this method so that it cycles between the frames in the current row of the animation. The animation frame should
+            //  only change after _millisecondsPerFrame milliseconds have elapsed. When the current frame is greater than or equal to the 
+            //  number of frames across, it should be reset to frame 0.
+
+            // The elapsedTime parameter contains the number of milliseconds that have passed since the last time this method was called.
+            //  In the fixed-time update system that we're using, this will always be 16 milliseconds (1000 / 16 = 60, or 60 frames per second).
+            
+            // Some fields that you should use:
+            
+            //  _timeSinceLastFrameChanged
+            //  Use this to accumulate time so that you can tell if _millisecondsPerFrame milliseconds have passed. Remember not to lose time
+            //   i.e. if your _millisecondsPerFrame value was 100, and your accumulated time since the last frame change was 105, the frame
+            //   should be changed, and the value in _timeSinceLastFrameChanged should be set to 5.
+
+            //  _currentFrameX
+            //  Use this to store the current frame X index.
+
+            //  _framesAcross
+            //  This value has been set up to contain the number of frames across, so you can tell when to loop back to the beginning.
+
+		}
+
+		public void Reset()
+		{
+			_currentFrameX = 0;
+		}
+
+		public void SetAnimationRow(int row)
+		{
+			_currentFrameY = row;
+		}
+
+		public void Draw(SpriteBatch spriteBatch)
+		{
+            // Todo:
+            // Complete this method so that it draws the correct frame of the texture that has been loaded into the _texture field.
+            //  Use the SpriteBatch.Draw method overload that accepts a sourceRectangle parameter to draw the correct frame.
+
+		}
+	}
+}

AnimatedSpritesLab/AnimatedSpritesLab/AnimatedSpritesLab.cs

+using System;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+
+namespace AnimatedSprites
+{
+	public class AnimatedSpritesLab : Game
+	{
+		private const int NumGridColumns = 7;
+		private const int NumGridRows = 7;
+		private const int GridCellWidth = 64;
+		private const int GridCellHeight = 64;
+
+		private GraphicsDeviceManager _graphics;
+		private SpriteBatch _spriteBatch;
+		private bool[] _grid = new bool[NumGridColumns * NumGridRows];
+		private Texture2D _tile;
+		private int _gridIndexThatMarioIsStandingIn;
+		private AnimatedSprite _marioSprite;
+
+
+		public AnimatedSpritesLab()
+		{
+			_graphics = new GraphicsDeviceManager(this);
+			Content.RootDirectory = "Content";
+			IsMouseVisible = true;
+		}
+
+		protected override void Initialize()
+		{
+			base.Initialize();
+			GenerateMaze();
+		}
+
+		private void GenerateMaze()
+		{
+			var tiles = new[]
+			              	{
+			              		0, 1, 0, 0, 0, 1, 0,
+			              		0, 0, 0, 1, 0, 1, 0,
+			              		0, 1, 0, 1, 0, 1, 0,
+			              		0, 1, 1, 1, 0, 1, 0,
+			              		0, 1, 0, 1, 0, 0, 0,
+			              		0, 1, 0, 0, 1, 0, 1,
+			              		0, 0, 0, 1, 0, 0, 0,
+
+			              	};
+
+			for (var i = 0; i < tiles.Length; i++)
+			{
+				if (tiles[i] == 1)
+					_grid[i] = true;
+			}
+		}
+
+		protected override void LoadContent()
+		{
+			_spriteBatch = new SpriteBatch(GraphicsDevice);
+			_tile = Content.Load<Texture2D>("StoneBlock");
+
+            // Todo:
+            // Create a new AnimatedSprite instance, and assign it to the _marioSprite field. The sprite should have the
+            //  following properties:
+            //
+            //  4 frames across
+            //  4 frames down
+            //  a frame width of 48
+            //  a frame height of 65
+            //  it should change frames 10 times a second
+            //  it should use the mario2 texture
+
+		}
+		
+		protected override void UnloadContent()
+		{
+		}
+
+		protected override void Update(GameTime gameTime)
+		{
+			if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
+				this.Exit();
+
+            var keyboardState = Keyboard.GetState();
+			var elapsedTime = (int)gameTime.ElapsedGameTime.TotalMilliseconds;
+			if (keyboardState.IsKeyDown(Keys.Right))
+			{
+				MoveMario(new Vector2(5, 0), elapsedTime);
+				_marioSprite.SetAnimationRow((int)FacingDirection.Right);
+			}
+			else if (keyboardState.IsKeyDown(Keys.Left))
+			{
+				MoveMario(new Vector2(-5, 0), elapsedTime);
+				_marioSprite.SetAnimationRow((int)FacingDirection.Left);
+			}
+			else if (keyboardState.IsKeyDown(Keys.Up))
+			{
+				MoveMario(new Vector2(0, -5), elapsedTime);
+				_marioSprite.SetAnimationRow((int)FacingDirection.Up);
+			}
+			else if (keyboardState.IsKeyDown(Keys.Down))
+			{
+				MoveMario(new Vector2(0, 5), elapsedTime);
+				_marioSprite.SetAnimationRow((int)FacingDirection.Down);
+			}
+
+			if (keyboardState.IsKeyUp(Keys.Right) && keyboardState.IsKeyUp(Keys.Left) && keyboardState.IsKeyUp(Keys.Up) && keyboardState.IsKeyUp(Keys.Down))
+			{
+				// Todo:
+                // Call the Reset method of the _marioSprite instance so that the current frame resets back to 0 when no keys are pressed.
+			}
+
+			base.Update(gameTime);
+		}
+
+		private void MoveMario(Vector2 positionDiff, int elapsedTime)
+		{
+			var marioCenter = GetMarioCenter();
+			
+			if (IsGridCellEmpty(GetGridIndex(marioCenter + positionDiff)))
+			{
+				if (_marioSprite.Position.X + positionDiff.X < NumGridRows * GridCellWidth &&
+					_marioSprite.Position.Y + positionDiff.Y < NumGridColumns * GridCellHeight)
+					_marioSprite.Position += positionDiff;
+			}
+
+            // Todo:
+            // Call the Update method of the _marioSprite instance, passing the elapsedTime value as its parameter.
+            
+
+
+
+
+
+            // Don't modify this method below this comment.
+
+			_gridIndexThatMarioIsStandingIn = GetGridIndex(GetMarioCenter());
+		}
+
+		private Vector2 GetMarioCenter()
+		{
+			return new Vector2
+					{
+						X = _marioSprite.Position.X + _marioSprite.FrameWidth / 2,
+						Y = _marioSprite.Position.Y + _marioSprite.FrameHeight / 2
+					};
+		}
+
+		protected override void Draw(GameTime gameTime)
+		{
+			const int tileVerticalOffset = 19;
+			GraphicsDevice.Clear(Color.Black);
+
+			_spriteBatch.Begin();
+			for (var i = 0; i < NumGridRows * NumGridColumns; i++)
+			{
+				if (i == _gridIndexThatMarioIsStandingIn)
+				{
+                    // Todo:
+                    // Call the Draw method of the _marioSprite instance, passing the _spriteBatch field as its only parameter.
+
+				}
+
+				if (_grid[i] == false)
+					continue;
+
+				var tilePosition = new Vector2
+									{
+										X = GridCellWidth * (i % NumGridColumns),
+										Y = (GridCellHeight * (i / NumGridRows)) - tileVerticalOffset
+									};
+				_spriteBatch.Draw(_tile, tilePosition, Color.White);
+			}
+
+			_spriteBatch.End();
+			base.Draw(gameTime);
+		}
+
+		private bool IsGridCellEmpty(int gridIndex)
+		{
+			if (gridIndex < 0 || gridIndex > _grid.Length - 1)
+				return false;
+
+			return _grid[gridIndex] == false;
+		}
+
+		private static int GetGridIndex(Vector2 position)
+		{
+			//			y * numOfThingsAcross + x
+			return (int)(Math.Floor(position.Y / GridCellHeight) * NumGridRows + Math.Floor(position.X / GridCellWidth));
+		}
+	}
+}

AnimatedSpritesLab/AnimatedSpritesLab/AnimatedSpritesLab.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectGuid>{7573BBF2-AA0F-4D53-856A-E7231D0EE136}</ProjectGuid>
+    <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>AnimatedSpritesLab</RootNamespace>
+    <AssemblyName>AnimatedSpritesLab</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
+    <XnaPlatform>Windows</XnaPlatform>
+    <XnaProfile>HiDef</XnaProfile>
+    <XnaCrossPlatformGroupID>3bf1d908-391c-472f-9747-b402e767766f</XnaCrossPlatformGroupID>
+    <XnaOutputType>Game</XnaOutputType>
+    <ApplicationIcon>Game.ico</ApplicationIcon>
+    <Thumbnail>GameThumbnail.png</Thumbnail>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\x86\Debug</OutputPath>
+    <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <NoStdLib>true</NoStdLib>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <PlatformTarget>x86</PlatformTarget>
+    <XnaCompressContent>false</XnaCompressContent>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\x86\Release</OutputPath>
+    <DefineConstants>TRACE;WINDOWS</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <NoStdLib>true</NoStdLib>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+    <PlatformTarget>x86</PlatformTarget>
+    <XnaCompressContent>true</XnaCompressContent>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Video, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Avatar, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Microsoft.Xna.Framework.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="mscorlib">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System.Xml">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System.Core">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System.Xml.Linq">
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System.Net">
+      <Private>False</Private>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AnimatedSprite.cs" />
+    <Compile Include="FacingDirection.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="AnimatedSpritesLab.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Game.ico" />
+    <Content Include="GameThumbnail.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\AnimatedSpritesContentLab\AnimatedSpritesLabContent.contentproj">
+      <Name>AnimatedSpritesLabContent %28Content%29</Name>
+      <XnaReferenceType>Content</XnaReferenceType>
+      <Project>{94862CFD-E1D9-414A-AB00-032651EDF9B8}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Xna.Framework.4.0">
+      <Visible>False</Visible>
+      <ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
+  <!--
+      To modify your build process, add your task inside one of the targets below and uncomment it. 
+      Other similar extension points exist, see Microsoft.Common.targets.
+      <Target Name="BeforeBuild">
+      </Target>
+      <Target Name="AfterBuild">
+      </Target>
+    -->
+</Project>

AnimatedSpritesLab/AnimatedSpritesLab/FacingDirection.cs

+namespace AnimatedSprites
+{
+	public enum FacingDirection
+	{
+		Up = 0,
+		Right = 1,
+		Down = 2,
+		Left = 3
+	}
+}

AnimatedSpritesLab/AnimatedSpritesLab/Game.ico

Added
New image

AnimatedSpritesLab/AnimatedSpritesLab/GameThumbnail.png

Added
New image

AnimatedSpritesLab/AnimatedSpritesLab/Program.cs

+using System;
+
+namespace AnimatedSprites
+{
+#if WINDOWS || XBOX
+    static class Program
+    {
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        static void Main(string[] args)
+        {
+            using (AnimatedSpritesLab game = new AnimatedSpritesLab())
+            {
+                game.Run();
+            }
+        }
+    }
+#endif
+}
+

AnimatedSpritesLab/AnimatedSpritesLab/Properties/AssemblyInfo.cs

+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("AnimatedSpritesLab-AnimatedSprites")]
+[assembly: AssemblyProduct("AnimatedSpritesLab-AnimatedSprites")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyCopyright("Copyright ©  2011")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type. Only Windows
+// assemblies support COM.
+[assembly: ComVisible(false)]
+
+// On Windows, the following GUID is for the ID of the typelib if this
+// project is exposed to COM. On other platforms, it unique identifies the
+// title storage container when deploying this assembly to the device.
+[assembly: Guid("d4a4daa9-43de-4cf7-85b4-de99cf4a8815")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]