]> Dogcows Code - chaz/carfire/commitdiff
git-svn-id: https://bd85.net/svn/cs3505_group@168 92bb83a3-7c8f-8a45-bc97-515c4e399668
authorKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Tue, 27 Apr 2010 19:54:08 +0000 (19:54 +0000)
committerKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Tue, 27 Apr 2010 19:54:08 +0000 (19:54 +0000)
CarFire/CarFire/CarFire/Melee.cs

index c6fb6e82f6aa48ef4094d67628e0ece327d097dc..03f5a65bcf27be1879abf276cc1454ad75f9bef2 100644 (file)
@@ -18,6 +18,7 @@ namespace CarFire
         int coolDown;\r
         Texture2D charModel;\r
         Texture2D projectileModel;\r
+        bool isAttacking;\r
         int velocityX;\r
         int velocityY;\r
         #endregion \r
@@ -41,6 +42,7 @@ namespace CarFire
 \r
             /*Zac\r
              */\r
+            \r
             animateMelee = new AnimateMelee(contentManager, this); \r
 \r
         }\r
@@ -54,6 +56,7 @@ namespace CarFire
             Point aPosition = Game.State.Map.GetPointFromCoordinates(Motion.Position);\r
             Vector2 drawPosition = new Vector2(aPosition.X, aPosition.Y);\r
             //spriteBatch.Draw(charModel, position, Color.White);\r
+            if (isAttacking)\r
             animateMelee.AttackLeft(spriteBatch, drawPosition);\r
             \r
         }\r
@@ -67,9 +70,10 @@ namespace CarFire
                 coolDown--;\r
             else if (coolDown == 0)\r
             {\r
-                \r
+                isAttacking = false;\r
                 if (keysPressed.Contains<Keys>(Keys.Space))\r
                 {\r
+                    isAttacking = true;\r
                     coolDown = hitCoolDown;\r
                     int startX = Coordinates.X;\r
                     int startY = Coordinates.Y;\r
This page took 0.020466 seconds and 4 git commands to generate.