X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fcarfire;a=blobdiff_plain;f=CarFire%2FCarFire%2FCarFire%2FMelee.cs;h=cb25ac81514530f916b051bb7125892163575eb2;hp=38be3038a5ae2e231affcf3ac3b9a29890173a65;hb=e8ee0aa62a7e8b5dffa9e02c00c3e353a9e93b4c;hpb=f67652c2fe85f9ba6c71dedbab26760775004e00 diff --git a/CarFire/CarFire/CarFire/Melee.cs b/CarFire/CarFire/CarFire/Melee.cs index 38be303..cb25ac8 100644 --- a/CarFire/CarFire/CarFire/Melee.cs +++ b/CarFire/CarFire/CarFire/Melee.cs @@ -22,6 +22,9 @@ namespace CarFire int velocityY; #endregion + //zac variable + AnimateMelee animateMelee; + #region Public Methods public Melee(Game theGame, String Name, Point position, int playerIndex) : base(theGame, Name, position, playerIndex, baseHealth, baseDamage) @@ -36,6 +39,10 @@ namespace CarFire charModel = contentManager.Load("cs"); //change to charModel when designed projectileModel = contentManager.Load("projectile"); //change to a projectile model later + /*Zac + */ + animateMelee = new AnimateMelee(contentManager); + } /// /// This method will draw a character to the screen. @@ -44,7 +51,9 @@ namespace CarFire public override void Draw(SpriteBatch spriteBatch) { Rectangle position = Game.State.Map.GetRectangleFromCoordinates(Motion.Position); - spriteBatch.Draw(charModel, position, Color.White); + //spriteBatch.Draw(charModel, position, Color.White); + animateMelee.AttackLeft(spriteBatch); + } public override void Attack(List keysPressed) @@ -53,8 +62,10 @@ namespace CarFire coolDown--; else if (coolDown == 0) { + if (keysPressed.Contains(Keys.Space)) { + coolDown = hitCoolDown; int startX = Coordinates.X; int startY = Coordinates.Y; if (Motion.Direction == Direction.Down || Motion.Direction == Direction.LowerLeft || Motion.Direction == Direction.LowerRight)