]> Dogcows Code - chaz/carfire/blobdiff - CarFire/CarFire/CarFire/Melee.cs
Implemented map tiles; started new Key entity; added missing variables to Melee.cs...
[chaz/carfire] / CarFire / CarFire / CarFire / Melee.cs
index f461aa69e8110b8b855e342a7638dcfc5c5badd8..f52301219c667184ef107a0d4f1e3cc366329288 100644 (file)
@@ -18,6 +18,8 @@ namespace CarFire
         int coolDown;\r
         Texture2D charModel;\r
         Texture2D projectileModel;\r
+        int velocityX;\r
+        int velocityY;\r
         #endregion \r
 \r
         #region Public Methods\r
@@ -53,7 +55,39 @@ namespace CarFire
             {\r
                 if (keysPressed.Contains<Keys>(Keys.Space))\r
                 {\r
-                    \r
+                    int startX = Coordinates.X;\r
+                    int startY = Coordinates.Y;\r
+                    if (Motion.Direction == Direction.Down || Motion.Direction == Direction.LowerLeft || Motion.Direction == Direction.LowerRight)\r
+                    {\r
+                        velocityY = 1;\r
+                        startY = Coordinates.Y + 1;\r
+                    }\r
+                    else if (Motion.Direction == Direction.Up || Motion.Direction == Direction.UpperLeft || Motion.Direction == Direction.UpperRight)\r
+                    {\r
+                        velocityY = -1;\r
+                        startY = Coordinates.Y - 1;\r
+                    }\r
+                    if (Motion.Direction == Direction.Right || Motion.Direction == Direction.LowerRight || Motion.Direction == Direction.UpperRight)\r
+                    {\r
+                        velocityX = 1;\r
+                        startX = Coordinates.X + 1;\r
+                    }\r
+                    else if (Motion.Direction == Direction.Left || Motion.Direction == Direction.LowerLeft || Motion.Direction == Direction.UpperLeft)\r
+                    {\r
+                        velocityX = -1;\r
+                        startX = Coordinates.X - 1;\r
+                    }\r
+                    //Attack a monster\r
+                    if (!Game.IsCellOpen(new Point(startX, startY)))\r
+                    {\r
+                        foreach (IEntity entity in Game.State.Entities)\r
+                        {\r
+                            //See if it is a monster\r
+\r
+                            //Damage the monster\r
+\r
+                        }\r
+                    }\r
                 }\r
             }\r
 \r
This page took 0.02231 seconds and 4 git commands to generate.