From 236bc590ff21370c1139a8c01ff35f7b30af743d Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 27 Apr 2010 19:54:08 +0000 Subject: [PATCH] git-svn-id: https://bd85.net/svn/cs3505_group@168 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- CarFire/CarFire/CarFire/Melee.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.45.2