Browse Source

Uploaded "Tutorial011"

Niall Lewin 7 years ago
parent
commit
ee6046963b
24 changed files with 787 additions and 0 deletions
  1. 6 0
      MonoGame_Tutorials/MonoGame_Tutorials.sln
  2. 63 0
      MonoGame_Tutorials/Tutorial011/Content/Content.mgcb
  3. BIN
      MonoGame_Tutorials/Tutorial011/Content/Player/WalkingDown.png
  4. BIN
      MonoGame_Tutorials/Tutorial011/Content/Player/WalkingLeft.png
  5. BIN
      MonoGame_Tutorials/Tutorial011/Content/Player/WalkingRight.png
  6. BIN
      MonoGame_Tutorials/Tutorial011/Content/Player/WalkingUp.png
  7. BIN
      MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingDown.xnb
  8. BIN
      MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingLeft.xnb
  9. BIN
      MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingRight.xnb
  10. BIN
      MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingUp.xnb
  11. 42 0
      MonoGame_Tutorials/Tutorial011/Content/obj/Windows/Player/WalkingDown.mgcontent
  12. 42 0
      MonoGame_Tutorials/Tutorial011/Content/obj/Windows/Player/WalkingLeft.mgcontent
  13. 42 0
      MonoGame_Tutorials/Tutorial011/Content/obj/Windows/Player/WalkingRight.mgcontent
  14. 42 0
      MonoGame_Tutorials/Tutorial011/Content/obj/Windows/Player/WalkingUp.mgcontent
  15. 137 0
      MonoGame_Tutorials/Tutorial011/Game1.cs
  16. BIN
      MonoGame_Tutorials/Tutorial011/Icon.ico
  17. 70 0
      MonoGame_Tutorials/Tutorial011/Managers/AnimationManager.cs
  18. 37 0
      MonoGame_Tutorials/Tutorial011/Models/Animation.cs
  19. 20 0
      MonoGame_Tutorials/Tutorial011/Models/Input.cs
  20. 22 0
      MonoGame_Tutorials/Tutorial011/Program.cs
  21. 36 0
      MonoGame_Tutorials/Tutorial011/Properties/AssemblyInfo.cs
  22. 111 0
      MonoGame_Tutorials/Tutorial011/Sprites/Sprite.cs
  23. 75 0
      MonoGame_Tutorials/Tutorial011/Tutorial011.csproj
  24. 42 0
      MonoGame_Tutorials/Tutorial011/app.manifest

+ 6 - 0
MonoGame_Tutorials/MonoGame_Tutorials.sln

@@ -19,6 +19,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tutorial020", "Tutorial020\
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tutorial007", "Tutorial007\Tutorial007.csproj", "{F24A8162-50D6-4AF5-A54D-940C8BC1DDBE}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tutorial011", "Tutorial011\Tutorial011.csproj", "{966ACA24-33A0-433E-93E9-69E631B84FFA}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|x86 = Debug|x86
@@ -57,6 +59,10 @@ Global
 		{F24A8162-50D6-4AF5-A54D-940C8BC1DDBE}.Debug|x86.Build.0 = Debug|x86
 		{F24A8162-50D6-4AF5-A54D-940C8BC1DDBE}.Release|x86.ActiveCfg = Release|x86
 		{F24A8162-50D6-4AF5-A54D-940C8BC1DDBE}.Release|x86.Build.0 = Release|x86
+		{966ACA24-33A0-433E-93E9-69E631B84FFA}.Debug|x86.ActiveCfg = Debug|x86
+		{966ACA24-33A0-433E-93E9-69E631B84FFA}.Debug|x86.Build.0 = Debug|x86
+		{966ACA24-33A0-433E-93E9-69E631B84FFA}.Release|x86.ActiveCfg = Release|x86
+		{966ACA24-33A0-433E-93E9-69E631B84FFA}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 63 - 0
MonoGame_Tutorials/Tutorial011/Content/Content.mgcb

@@ -0,0 +1,63 @@
+
+#----------------------------- Global Properties ----------------------------#
+
+/outputDir:bin/$(Platform)
+/intermediateDir:obj/$(Platform)
+/platform:Windows
+/config:
+/profile:Reach
+/compress:False
+
+#-------------------------------- References --------------------------------#
+
+
+#---------------------------------- Content ---------------------------------#
+
+#begin Player/WalkingUp.png
+/importer:TextureImporter
+/processor:TextureProcessor
+/processorParam:ColorKeyColor=255,0,255,255
+/processorParam:ColorKeyEnabled=True
+/processorParam:GenerateMipmaps=False
+/processorParam:PremultiplyAlpha=True
+/processorParam:ResizeToPowerOfTwo=False
+/processorParam:MakeSquare=False
+/processorParam:TextureFormat=Color
+/build:Player/WalkingUp.png
+
+#begin Player/WalkingRight.png
+/importer:TextureImporter
+/processor:TextureProcessor
+/processorParam:ColorKeyColor=255,0,255,255
+/processorParam:ColorKeyEnabled=True
+/processorParam:GenerateMipmaps=False
+/processorParam:PremultiplyAlpha=True
+/processorParam:ResizeToPowerOfTwo=False
+/processorParam:MakeSquare=False
+/processorParam:TextureFormat=Color
+/build:Player/WalkingRight.png
+
+#begin Player/WalkingLeft.png
+/importer:TextureImporter
+/processor:TextureProcessor
+/processorParam:ColorKeyColor=255,0,255,255
+/processorParam:ColorKeyEnabled=True
+/processorParam:GenerateMipmaps=False
+/processorParam:PremultiplyAlpha=True
+/processorParam:ResizeToPowerOfTwo=False
+/processorParam:MakeSquare=False
+/processorParam:TextureFormat=Color
+/build:Player/WalkingLeft.png
+
+#begin Player/WalkingDown.png
+/importer:TextureImporter
+/processor:TextureProcessor
+/processorParam:ColorKeyColor=255,0,255,255
+/processorParam:ColorKeyEnabled=True
+/processorParam:GenerateMipmaps=False
+/processorParam:PremultiplyAlpha=True
+/processorParam:ResizeToPowerOfTwo=False
+/processorParam:MakeSquare=False
+/processorParam:TextureFormat=Color
+/build:Player/WalkingDown.png
+

BIN
MonoGame_Tutorials/Tutorial011/Content/Player/WalkingDown.png


BIN
MonoGame_Tutorials/Tutorial011/Content/Player/WalkingLeft.png


BIN
MonoGame_Tutorials/Tutorial011/Content/Player/WalkingRight.png


BIN
MonoGame_Tutorials/Tutorial011/Content/Player/WalkingUp.png


BIN
MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingDown.xnb


BIN
MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingLeft.xnb


BIN
MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingRight.xnb


BIN
MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingUp.xnb


+ 42 - 0
MonoGame_Tutorials/Tutorial011/Content/obj/Windows/Player/WalkingDown.mgcontent

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <SourceFile>C:/Share/MonoGame_Tutorials/Tutorial011/Content/Player/WalkingDown.png</SourceFile>
+  <SourceTime>2018-05-11T11:01:32.5249495+01:00</SourceTime>
+  <DestFile>C:/Share/MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingDown.xnb</DestFile>
+  <DestTime>2018-05-11T11:03:24.0217017+01:00</DestTime>
+  <Importer>TextureImporter</Importer>
+  <ImporterTime>2017-03-01T15:05:36+00:00</ImporterTime>
+  <Processor>TextureProcessor</Processor>
+  <ProcessorTime>2017-03-01T15:05:36+00:00</ProcessorTime>
+  <Parameters>
+    <Key>ColorKeyColor</Key>
+    <Value>255,0,255,255</Value>
+  </Parameters>
+  <Parameters>
+    <Key>ColorKeyEnabled</Key>
+    <Value>True</Value>
+  </Parameters>
+  <Parameters>
+    <Key>GenerateMipmaps</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>PremultiplyAlpha</Key>
+    <Value>True</Value>
+  </Parameters>
+  <Parameters>
+    <Key>ResizeToPowerOfTwo</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>MakeSquare</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>TextureFormat</Key>
+    <Value>Color</Value>
+  </Parameters>
+  <Dependencies />
+  <BuildAsset />
+  <BuildOutput />
+</PipelineBuildEvent>

+ 42 - 0
MonoGame_Tutorials/Tutorial011/Content/obj/Windows/Player/WalkingLeft.mgcontent

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <SourceFile>C:/Share/MonoGame_Tutorials/Tutorial011/Content/Player/WalkingLeft.png</SourceFile>
+  <SourceTime>2018-05-11T11:01:37.2709495+01:00</SourceTime>
+  <DestFile>C:/Share/MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingLeft.xnb</DestFile>
+  <DestTime>2018-05-11T11:03:23.9966992+01:00</DestTime>
+  <Importer>TextureImporter</Importer>
+  <ImporterTime>2017-03-01T15:05:36+00:00</ImporterTime>
+  <Processor>TextureProcessor</Processor>
+  <ProcessorTime>2017-03-01T15:05:36+00:00</ProcessorTime>
+  <Parameters>
+    <Key>ColorKeyColor</Key>
+    <Value>255,0,255,255</Value>
+  </Parameters>
+  <Parameters>
+    <Key>ColorKeyEnabled</Key>
+    <Value>True</Value>
+  </Parameters>
+  <Parameters>
+    <Key>GenerateMipmaps</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>PremultiplyAlpha</Key>
+    <Value>True</Value>
+  </Parameters>
+  <Parameters>
+    <Key>ResizeToPowerOfTwo</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>MakeSquare</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>TextureFormat</Key>
+    <Value>Color</Value>
+  </Parameters>
+  <Dependencies />
+  <BuildAsset />
+  <BuildOutput />
+</PipelineBuildEvent>

+ 42 - 0
MonoGame_Tutorials/Tutorial011/Content/obj/Windows/Player/WalkingRight.mgcontent

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <SourceFile>C:/Share/MonoGame_Tutorials/Tutorial011/Content/Player/WalkingRight.png</SourceFile>
+  <SourceTime>2018-05-11T11:01:43.6689495+01:00</SourceTime>
+  <DestFile>C:/Share/MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingRight.xnb</DestFile>
+  <DestTime>2018-05-11T11:03:23.9606956+01:00</DestTime>
+  <Importer>TextureImporter</Importer>
+  <ImporterTime>2017-03-01T15:05:36+00:00</ImporterTime>
+  <Processor>TextureProcessor</Processor>
+  <ProcessorTime>2017-03-01T15:05:36+00:00</ProcessorTime>
+  <Parameters>
+    <Key>ColorKeyColor</Key>
+    <Value>255,0,255,255</Value>
+  </Parameters>
+  <Parameters>
+    <Key>ColorKeyEnabled</Key>
+    <Value>True</Value>
+  </Parameters>
+  <Parameters>
+    <Key>GenerateMipmaps</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>PremultiplyAlpha</Key>
+    <Value>True</Value>
+  </Parameters>
+  <Parameters>
+    <Key>ResizeToPowerOfTwo</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>MakeSquare</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>TextureFormat</Key>
+    <Value>Color</Value>
+  </Parameters>
+  <Dependencies />
+  <BuildAsset />
+  <BuildOutput />
+</PipelineBuildEvent>

+ 42 - 0
MonoGame_Tutorials/Tutorial011/Content/obj/Windows/Player/WalkingUp.mgcontent

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <SourceFile>C:/Share/MonoGame_Tutorials/Tutorial011/Content/Player/WalkingUp.png</SourceFile>
+  <SourceTime>2018-05-11T11:01:48.7199495+01:00</SourceTime>
+  <DestFile>C:/Share/MonoGame_Tutorials/Tutorial011/Content/bin/Windows/Player/WalkingUp.xnb</DestFile>
+  <DestTime>2018-05-11T11:03:23.9126908+01:00</DestTime>
+  <Importer>TextureImporter</Importer>
+  <ImporterTime>2017-03-01T15:05:36+00:00</ImporterTime>
+  <Processor>TextureProcessor</Processor>
+  <ProcessorTime>2017-03-01T15:05:36+00:00</ProcessorTime>
+  <Parameters>
+    <Key>ColorKeyColor</Key>
+    <Value>255,0,255,255</Value>
+  </Parameters>
+  <Parameters>
+    <Key>ColorKeyEnabled</Key>
+    <Value>True</Value>
+  </Parameters>
+  <Parameters>
+    <Key>GenerateMipmaps</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>PremultiplyAlpha</Key>
+    <Value>True</Value>
+  </Parameters>
+  <Parameters>
+    <Key>ResizeToPowerOfTwo</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>MakeSquare</Key>
+    <Value>False</Value>
+  </Parameters>
+  <Parameters>
+    <Key>TextureFormat</Key>
+    <Value>Color</Value>
+  </Parameters>
+  <Dependencies />
+  <BuildAsset />
+  <BuildOutput />
+</PipelineBuildEvent>

+ 137 - 0
MonoGame_Tutorials/Tutorial011/Game1.cs

@@ -0,0 +1,137 @@
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using System.Collections.Generic;
+using Tutorial011.Models;
+using Tutorial011.Sprites;
+
+namespace Tutorial011
+{
+  /// <summary>
+  /// This is the main type for your game.
+  /// </summary>
+  public class Game1 : Game
+  {
+    GraphicsDeviceManager graphics;
+    SpriteBatch spriteBatch;
+
+    private List<Sprite> _sprites;
+
+    public Game1()
+    {
+      graphics = new GraphicsDeviceManager(this);
+      Content.RootDirectory = "Content";
+    }
+
+    /// <summary>
+    /// Allows the game to perform any initialization it needs to before starting to run.
+    /// This is where it can query for any required services and load any non-graphic
+    /// related content.  Calling base.Initialize will enumerate through any components
+    /// and initialize them as well.
+    /// </summary>
+    protected override void Initialize()
+    {
+      // TODO: Add your initialization logic here
+
+      base.Initialize();
+    }
+
+    /// <summary>
+    /// LoadContent will be called once per game and is the place to load
+    /// all of your content.
+    /// </summary>
+    protected override void LoadContent()
+    {
+      // Create a new SpriteBatch, which can be used to draw textures.
+      spriteBatch = new SpriteBatch(GraphicsDevice);
+
+      // NOTE: I no-longer use this reference as it affects different objects if being used multiple times!
+      var animations = new Dictionary<string, Animation>()
+      {
+        { "WalkUp", new Animation(Content.Load<Texture2D>("Player/WalkingUp"), 3) },
+        { "WalkDown", new Animation(Content.Load<Texture2D>("Player/WalkingDown"), 3) },
+        { "WalkLeft", new Animation(Content.Load<Texture2D>("Player/WalkingLeft"), 3) },
+        { "WalkRight", new Animation(Content.Load<Texture2D>("Player/WalkingRight"), 3) },
+      };
+
+      _sprites = new List<Sprite>()
+      {
+        new Sprite(new Dictionary<string, Animation>()
+        {
+          { "WalkUp", new Animation(Content.Load<Texture2D>("Player/WalkingUp"), 3) },
+          { "WalkDown", new Animation(Content.Load<Texture2D>("Player/WalkingDown"), 3) },
+          { "WalkLeft", new Animation(Content.Load<Texture2D>("Player/WalkingLeft"), 3) },
+          { "WalkRight", new Animation(Content.Load<Texture2D>("Player/WalkingRight"), 3) },
+        })
+        {
+          Position = new Vector2(100, 100),
+          Input = new Input()
+          {
+            Up = Keys.W,
+            Down = Keys.S,
+            Left = Keys.A,
+            Right = Keys.D,
+          },
+        },
+        new Sprite(new Dictionary<string, Animation>()
+        {
+          { "WalkUp", new Animation(Content.Load<Texture2D>("Player/WalkingUp"), 3) },
+          { "WalkDown", new Animation(Content.Load<Texture2D>("Player/WalkingDown"), 3) },
+          { "WalkLeft", new Animation(Content.Load<Texture2D>("Player/WalkingLeft"), 3) },
+          { "WalkRight", new Animation(Content.Load<Texture2D>("Player/WalkingRight"), 3) },
+        })
+        {
+          Position = new Vector2(150, 100),
+          Input = new Input()
+          {
+            Up = Keys.Up,
+            Down = Keys.Down,
+            Left = Keys.Left,
+            Right = Keys.Right,
+          },
+        },
+      };
+    }
+
+    /// <summary>
+    /// UnloadContent will be called once per game and is the place to unload
+    /// game-specific content.
+    /// </summary>
+    protected override void UnloadContent()
+    {
+      // TODO: Unload any non ContentManager content here
+    }
+
+    /// <summary>
+    /// Allows the game to run logic such as updating the world,
+    /// checking for collisions, gathering input, and playing audio.
+    /// </summary>
+    /// <param name="gameTime">Provides a snapshot of timing values.</param>
+    protected override void Update(GameTime gameTime)
+    {
+      foreach (var sprite in _sprites)
+        sprite.Update(gameTime, _sprites);
+
+      base.Update(gameTime);
+    }
+
+    /// <summary>
+    /// This is called when the game should draw itself.
+    /// </summary>
+    /// <param name="gameTime">Provides a snapshot of timing values.</param>
+    protected override void Draw(GameTime gameTime)
+    {
+      GraphicsDevice.Clear(Color.CornflowerBlue);
+
+      spriteBatch.Begin();
+
+      foreach (var sprite in _sprites)
+        sprite.Draw(spriteBatch);
+
+      spriteBatch.End();
+
+      base.Draw(gameTime);
+    }
+  }
+}

BIN
MonoGame_Tutorials/Tutorial011/Icon.ico


+ 70 - 0
MonoGame_Tutorials/Tutorial011/Managers/AnimationManager.cs

@@ -0,0 +1,70 @@
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tutorial011.Models;
+
+namespace Tutorial011.Managers
+{
+  public class AnimationManager
+  {
+    private Animation _animation;
+
+    private float _timer;
+
+    public Vector2 Position { get; set; }
+
+    public AnimationManager(Animation animation)
+    {
+      _animation = animation;
+    }
+
+    public void Draw(SpriteBatch spriteBatch)
+    {
+      spriteBatch.Draw(_animation.Texture,
+                       Position,
+                       new Rectangle(_animation.CurrentFrame * _animation.FrameWidth,
+                                     0,
+                                     _animation.FrameWidth,
+                                     _animation.FrameHeight),
+                       Color.White);
+    }
+
+    public void Play(Animation animation)
+    {
+      if (_animation == animation)
+        return;
+
+      _animation = animation;
+
+      _animation.CurrentFrame = 0;
+
+      _timer = 0;
+    }
+
+    public void Stop()
+    {
+      _timer = 0f;
+
+      _animation.CurrentFrame = 0;
+    }
+
+    public void Update(GameTime gameTime)
+    {
+      _timer += (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+      if(_timer > _animation.FrameSpeed)
+      {
+        _timer = 0f;
+
+        _animation.CurrentFrame++;
+
+        if (_animation.CurrentFrame >= _animation.FrameCount)
+          _animation.CurrentFrame = 0;
+      }
+    }
+  }
+}

+ 37 - 0
MonoGame_Tutorials/Tutorial011/Models/Animation.cs

@@ -0,0 +1,37 @@
+using Microsoft.Xna.Framework.Graphics;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tutorial011.Models
+{
+  public class Animation
+  {
+    public int CurrentFrame { get; set; }
+
+    public int FrameCount { get; private set; }
+
+    public int FrameHeight { get { return Texture.Height; } }
+
+    public float FrameSpeed { get; set; }
+
+    public int FrameWidth { get { return Texture.Width / FrameCount; } }
+
+    public bool IsLooping { get; set; }
+
+    public Texture2D Texture { get; private set; }
+
+    public Animation(Texture2D texture, int frameCount)
+    {
+      Texture = texture;
+
+      FrameCount = frameCount;
+
+      IsLooping = true;
+
+      FrameSpeed = 0.2f;
+    }
+  }
+}

+ 20 - 0
MonoGame_Tutorials/Tutorial011/Models/Input.cs

@@ -0,0 +1,20 @@
+using Microsoft.Xna.Framework.Input;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tutorial011.Models
+{
+  public class Input
+  {
+    public Keys Down { get; set; }
+
+    public Keys Left { get; set; }
+
+    public Keys Right { get; set; }
+
+    public Keys Up { get; set; }
+  }
+}

+ 22 - 0
MonoGame_Tutorials/Tutorial011/Program.cs

@@ -0,0 +1,22 @@
+using System;
+
+namespace Tutorial011
+{
+#if WINDOWS || LINUX
+    /// <summary>
+    /// The main class.
+    /// </summary>
+    public static class Program
+    {
+        /// <summary>
+        /// The main entry point for the application.
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            using (var game = new Game1())
+                game.Run();
+        }
+    }
+#endif
+}

+ 36 - 0
MonoGame_Tutorials/Tutorial011/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+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("Tutorial011")]
+[assembly: AssemblyProduct("Tutorial011")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyCompany("DST")]
+[assembly: AssemblyCopyright("Copyright © DST 2018")]
+[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.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("efdfc855-8dac-429b-9148-9a7c9e2a188b")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 111 - 0
MonoGame_Tutorials/Tutorial011/Sprites/Sprite.cs

@@ -0,0 +1,111 @@
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tutorial011.Managers;
+using Tutorial011.Models;
+
+namespace Tutorial011.Sprites
+{
+  public class Sprite
+  {
+    #region Fields
+
+    protected AnimationManager _animationManager;
+
+    protected Dictionary<string, Animation> _animations;
+
+    protected Vector2 _position;
+
+    protected Texture2D _texture;
+
+    #endregion
+
+    #region Properties
+
+    public Input Input;
+
+    public Vector2 Position
+    {
+      get { return _position; }
+      set
+      {
+        _position = value;
+
+        if (_animationManager != null)
+          _animationManager.Position = _position;
+      }
+    }
+
+    public float Speed = 1f;
+
+    public Vector2 Velocity;
+
+    #endregion
+
+    #region Methods
+
+    public virtual void Draw(SpriteBatch spriteBatch)
+    {
+      if (_texture != null)
+        spriteBatch.Draw(_texture, Position, Color.White);
+      else if (_animationManager != null)
+        _animationManager.Draw(spriteBatch);
+      else throw new Exception("This ain't right..!");
+    }
+
+    public virtual void Move()
+    {
+      if (Keyboard.GetState().IsKeyDown(Input.Up))
+        Velocity.Y = -Speed;
+      else if (Keyboard.GetState().IsKeyDown(Input.Down))
+        Velocity.Y = Speed;
+      else if (Keyboard.GetState().IsKeyDown(Input.Left))
+        Velocity.X = -Speed;
+      else if (Keyboard.GetState().IsKeyDown(Input.Right))
+        Velocity.X = Speed;
+    }
+
+    protected virtual void SetAnimations()
+    {
+      if (Velocity.X > 0)
+        _animationManager.Play(_animations["WalkRight"]);
+      else if (Velocity.X < 0)
+        _animationManager.Play(_animations["WalkLeft"]);
+      else if (Velocity.Y > 0)
+        _animationManager.Play(_animations["WalkDown"]);
+      else if (Velocity.Y < 0)
+        _animationManager.Play(_animations["WalkUp"]);
+      else _animationManager.Stop();
+    }
+
+    public Sprite(Dictionary<string, Animation> animations)
+    {
+      _animations = animations;
+      _animationManager = new AnimationManager(_animations.First().Value);
+    }
+
+    public Sprite(Texture2D texture)
+    {
+      _texture = texture;
+    }
+
+    public virtual void Update(GameTime gameTime, List<Sprite> sprites)
+    {
+      Move();
+
+      SetAnimations();
+
+      _animationManager.Update(gameTime);
+
+      Position += Velocity;
+      Velocity = Vector2.Zero;
+    }
+
+    #endregion
+  }
+}

+ 75 - 0
MonoGame_Tutorials/Tutorial011/Tutorial011.csproj

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{966ACA24-33A0-433E-93E9-69E631B84FFA}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Tutorial011</RootNamespace>
+    <AssemblyName>Tutorial011</AssemblyName>
+    <FileAlignment>512</FileAlignment>
+    <MonoGamePlatform>Windows</MonoGamePlatform>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
+    <DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
+    <DefineConstants>TRACE;WINDOWS</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationIcon>Icon.ico</ApplicationIcon>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationManifest>app.manifest</ApplicationManifest>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="Game1.cs" />
+    <Compile Include="Managers\AnimationManager.cs" />
+    <Compile Include="Models\Animation.cs" />
+    <Compile Include="Models\Input.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Sprites\Sprite.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="MonoGame.Framework">
+      <HintPath>$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Icon.ico" />
+  </ItemGroup>
+  <ItemGroup>
+    <MonoGameContentReference Include="Content\Content.mgcb" />
+    <None Include="app.manifest" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.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>

+ 42 - 0
MonoGame_Tutorials/Tutorial011/app.manifest

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+  <assemblyIdentity version="1.0.0.0" name="Tutorial011"/>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <!-- A list of the Windows versions that this application has been tested on and is
+           is designed to work with. Uncomment the appropriate elements and Windows will 
+           automatically selected the most compatible environment. -->
+
+      <!-- Windows Vista -->
+      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
+
+      <!-- Windows 7 -->
+      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
+
+      <!-- Windows 8 -->
+      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
+
+      <!-- Windows 8.1 -->
+      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
+
+      <!-- Windows 10 -->
+      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
+
+    </application>
+  </compatibility>
+
+  <application xmlns="urn:schemas-microsoft-com:asm.v3">
+    <windowsSettings>
+      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
+    </windowsSettings>
+  </application>
+
+</assembly>