From b5eebc2087c00bb67b3a3b9ddcec4743aa7a8cdb Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 23 Apr 2010 20:43:58 +0000 Subject: [PATCH] git-svn-id: https://bd85.net/svn/cs3505_group@141 92bb83a3-7c8f-8a45-bc97-515c4e399668 --- CarFire/CarFire/CarFire/Melee.cs | 34 +++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/CarFire/CarFire/CarFire/Melee.cs b/CarFire/CarFire/CarFire/Melee.cs index f461aa6..4c053a6 100644 --- a/CarFire/CarFire/CarFire/Melee.cs +++ b/CarFire/CarFire/CarFire/Melee.cs @@ -53,7 +53,39 @@ namespace CarFire { if (keysPressed.Contains(Keys.Space)) { - + int startX = Coordinates.X; + int startY = Coordinates.Y; + if (Motion.Direction == Direction.Down || Motion.Direction == Direction.LowerLeft || Motion.Direction == Direction.LowerRight) + { + velocityY = 1; + startY = Coordinates.Y + 1; + } + else if (Motion.Direction == Direction.Up || Motion.Direction == Direction.UpperLeft || Motion.Direction == Direction.UpperRight) + { + velocityY = -1; + startY = Coordinates.Y - 1; + } + if (Motion.Direction == Direction.Right || Motion.Direction == Direction.LowerRight || Motion.Direction == Direction.UpperRight) + { + velocityX = 1; + startX = Coordinates.X + 1; + } + else if (Motion.Direction == Direction.Left || Motion.Direction == Direction.LowerLeft || Motion.Direction == Direction.UpperLeft) + { + velocityX = -1; + startX = Coordinates.X - 1; + } + //Attack a monster + if (!Game.IsCellOpen(new Point(startX, startY))) + { + foreach (IEntity entity in Game.State.Entities) + { + //See if it is a monster + + //Damage the monster + + } + } } } -- 2.43.0