]> Dogcows Code - chaz/carfire/commitdiff
git-svn-id: https://bd85.net/svn/cs3505_group@141 92bb83a3-7c8f-8a45-bc97-515c4e399668
authorKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Fri, 23 Apr 2010 20:43:58 +0000 (20:43 +0000)
committerKyle <Kyle@92bb83a3-7c8f-8a45-bc97-515c4e399668>
Fri, 23 Apr 2010 20:43:58 +0000 (20:43 +0000)
CarFire/CarFire/CarFire/Melee.cs

index f461aa69e8110b8b855e342a7638dcfc5c5badd8..4c053a6a8c26a7efd14b9786ed5bb56594a12334 100644 (file)
@@ -53,7 +53,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.026735 seconds and 4 git commands to generate.