--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+using Microsoft.Xna.Framework;\r
+using Microsoft.Xna.Framework.Graphics;\r
+using Microsoft.Xna.Framework.Content;\r
+\r
+namespace CarFire\r
+{\r
+ class AnimateMelee\r
+ {\r
+\r
+ //member variables\r
+ private AnimatedTexture SpriteTexture;\r
+ string[] fileNames = new string[] { "graphics/meleeAttack", "graphics/meleeDying", \r
+ "graphics/meleeExplosion", "graphics/meleeStanding", "graphics/meleeWalking" };\r
+ private ContentManager contentManager;\r
+ //private GraphicsDeviceManager graphics;\r
+ //private SpriteBatch spriteBatch;\r
+\r
+ private string ph;\r
+ private Vector2 position;\r
+ private SpriteBatch character;\r
+\r
+ //constructor(s)\r
+ public AnimateMelee(ContentManager content)\r
+ {\r
+ SpriteTexture = new AnimatedTexture(Vector2.Zero, 0, 1.0f, 0.5f);\r
+ contentManager = content;\r
+ ph = fileNames[3];\r
+ position = Vector2.Zero;\r
+ }\r
+\r
+ //methods\r
+\r
+ public void AttackLeft(SpriteBatch spriteBatch)\r
+ {\r
+ ph = fileNames[0];\r
+ //graphics = graphicsDeviceManager;\r
+ //this.spriteBatch = spriteBatch;\r
+ //spriteBatch.\r
+\r
+ character = new SpriteBatch(spriteBatch.GraphicsDevice);\r
+ Animate();\r
+\r
+\r
+ // SpriteTexture.Load(graphics.GraphicsDevice, contentManager, "fileNames[0]", 8, 12, true, 1);\r
+ }\r
+\r
+ public void Animate()\r
+ {\r
+ //character = new SpriteBatch(graphics.GraphicsDevice);\r
+ // "character" is the name of the sprite asset in the project.\r
+ Console.WriteLine(ph);\r
+ SpriteTexture.Load(character.GraphicsDevice, contentManager, ph, 8, 12, true, 1);\r
+ //viewport = graphics.GraphicsDevice.Viewport;\r
+ position = new Vector2(0, 0);//viewport.Width / 2, 0);//viewport.Height / 2f);\r
+\r
+ character.Begin();\r
+ SpriteTexture.DrawFrame(character, position);\r
+ character.End();\r
+ }\r
+\r
+ }\r
+}\r