From 8d30b5ac461e95cabfc74e46b610beabd81cb460 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Sun, 14 Jan 2018 13:42:38 +0100 Subject: upgrade menu --- Penguloon/Objects/ObjectBase.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Penguloon/Objects/ObjectBase.cs') diff --git a/Penguloon/Objects/ObjectBase.cs b/Penguloon/Objects/ObjectBase.cs index 6474afe..aef4e6a 100644 --- a/Penguloon/Objects/ObjectBase.cs +++ b/Penguloon/Objects/ObjectBase.cs @@ -35,6 +35,8 @@ namespace Penguloon.Objects public bool ShouldRotate { get; set; } = true; + public bool Selected { get; set; } = false; + public ObjectBase(Vector2 position, Map map) { this.Map = map; @@ -162,6 +164,19 @@ namespace Penguloon.Objects destinationRectangle: rec, rotation: (float)rot, origin: new Vector2(Texture.Width / 2, Texture.Height / 2)); + + if (Selected) + { + Rectangle rangeCircleRec = new Rectangle( + (int)Position.X + ((TileSpanX * Map.TileWidth) / 2), + (int)Position.Y + ((TileSpanY * Map.TileHeight) / 2), + (int)(Range * 2), (int)(Range * 2)); + + if (RangeCircle != null) + Map.ParentScene.Main.SpriteBatch.Draw(RangeCircle, + destinationRectangle: rangeCircleRec, + origin: new Vector2(RangeCircle.Width / 2, RangeCircle.Height / 2)); + } } public abstract void DrawUnique(float deltaTime); -- cgit v1.2.3-70-g09d2