From: Kyle Date: Tue, 27 Apr 2010 19:54:08 +0000 (+0000) Subject: git-svn-id: https://bd85.net/svn/cs3505_group@168 92bb83a3-7c8f-8a45-bc97-515c4e399668 X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=236bc590ff21370c1139a8c01ff35f7b30af743d;p=chaz%2Fcarfire git-svn-id: https://bd85.net/svn/cs3505_group@168 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- diff --git a/CarFire/CarFire/CarFire/Melee.cs b/CarFire/CarFire/CarFire/Melee.cs index c6fb6e8..03f5a65 100644 --- a/CarFire/CarFire/CarFire/Melee.cs +++ b/CarFire/CarFire/CarFire/Melee.cs @@ -18,6 +18,7 @@ namespace CarFire int coolDown; Texture2D charModel; Texture2D projectileModel; + bool isAttacking; int velocityX; int velocityY; #endregion @@ -41,6 +42,7 @@ namespace CarFire /*Zac */ + animateMelee = new AnimateMelee(contentManager, this); } @@ -54,6 +56,7 @@ namespace CarFire Point aPosition = Game.State.Map.GetPointFromCoordinates(Motion.Position); Vector2 drawPosition = new Vector2(aPosition.X, aPosition.Y); //spriteBatch.Draw(charModel, position, Color.White); + if (isAttacking) animateMelee.AttackLeft(spriteBatch, drawPosition); } @@ -67,9 +70,10 @@ namespace CarFire coolDown--; else if (coolDown == 0) { - + isAttacking = false; if (keysPressed.Contains(Keys.Space)) { + isAttacking = true; coolDown = hitCoolDown; int startX = Coordinates.X; int startY = Coordinates.Y;