From e1a519cd280af663b739beb4342af6740fe04ef1 Mon Sep 17 00:00:00 2001 From: Niklas Ulf Anders Cullberg Date: Tue, 25 Sep 2012 21:52:21 +0200 Subject: [PATCH] Inserted selection collision with soldier --- DepthsBelow/DepthsBelow/Component/Collision.cs | 2 +- DepthsBelow/DepthsBelow/MouseInput.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DepthsBelow/DepthsBelow/Component/Collision.cs b/DepthsBelow/DepthsBelow/Component/Collision.cs index 4123c1b..717d152 100644 --- a/DepthsBelow/DepthsBelow/Component/Collision.cs +++ b/DepthsBelow/DepthsBelow/Component/Collision.cs @@ -19,7 +19,7 @@ namespace DepthsBelow.Component { this.Width = width; this.Height = height; - this.Rectangle = new Rectangle(0, 0, width, height); + this.Rectangle = new Rectangle(0, 0, width, height); } public void Update(GameTime gameTime) { diff --git a/DepthsBelow/DepthsBelow/MouseInput.cs b/DepthsBelow/DepthsBelow/MouseInput.cs index 104c3b3..157f129 100644 --- a/DepthsBelow/DepthsBelow/MouseInput.cs +++ b/DepthsBelow/DepthsBelow/MouseInput.cs @@ -49,7 +49,8 @@ namespace DepthsBelow if (ms.LeftButton == ButtonState.Released && selectionRectangle != Rectangle.Empty) { - if (selectionRectangle.Intersects(core.soldier.collision.Rectangle)) + + if (selectionRectangle.Intersects(core.soldier.GetComponent().Rectangle)) { core.soldier.selected = true; }