Inserted selection collision with soldier
This commit is contained in:
@@ -19,7 +19,7 @@ namespace DepthsBelow.Component
|
|||||||
{
|
{
|
||||||
this.Width = width;
|
this.Width = width;
|
||||||
this.Height = height;
|
this.Height = height;
|
||||||
this.Rectangle = new Rectangle(0, 0, width, height);
|
this.Rectangle = new Rectangle(0, 0, width, height);
|
||||||
}
|
}
|
||||||
public void Update(GameTime gameTime)
|
public void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ namespace DepthsBelow
|
|||||||
|
|
||||||
if (ms.LeftButton == ButtonState.Released && selectionRectangle != Rectangle.Empty)
|
if (ms.LeftButton == ButtonState.Released && selectionRectangle != Rectangle.Empty)
|
||||||
{
|
{
|
||||||
if (selectionRectangle.Intersects(core.soldier.collision.Rectangle))
|
|
||||||
|
if (selectionRectangle.Intersects(core.soldier.GetComponent<Component.Collision>().Rectangle))
|
||||||
{
|
{
|
||||||
core.soldier.selected = true;
|
core.soldier.selected = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user