From a05ae287aa87259817e6ca7627986e14eeab6098 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Tue, 2 Jan 2018 23:36:55 +0100 Subject: dank --- Penguloon/Controls/ObjectSelector.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'Penguloon/Controls/ObjectSelector.cs') diff --git a/Penguloon/Controls/ObjectSelector.cs b/Penguloon/Controls/ObjectSelector.cs index a13f3eb..56dff8a 100644 --- a/Penguloon/Controls/ObjectSelector.cs +++ b/Penguloon/Controls/ObjectSelector.cs @@ -126,7 +126,8 @@ namespace Penguloon.Controls Objects.Add(new Tuple(new PenguinObject(Map), 250)); Objects.Add(new Tuple(new GoldPenguinObject(Map), 360)); Objects.Add(new Tuple(new CannonObject(Map), 650)); - Objects.Add(new Tuple(new HealthGeneratorObject(Map), 150)); + Objects.Add(new Tuple(new HealthGeneratorObject(Map), 800)); + Objects.Add(new Tuple(new MortarObject(Map), 150)); } public override void Update(float deltaTime, TouchLocation[] touchLocations) @@ -166,8 +167,18 @@ namespace Penguloon.Controls destinationRectangle: new Rectangle(posX, (int)Position.Y + posY, width, height)); } - int widthToDraw = (height / Objects[i].Item1.TileSpanY) - (padding * 2); - int heightToDraw = (height / Objects[i].Item1.TileSpanX) - (padding * (3 - Objects[i].Item1.TileSpanX)); + //int widthToDraw = (height / Objects[i].Item1.TileSpanY) - (padding * (3 - Objects[i].Item1.TileSpanY)); + //int heightToDraw = (height / Objects[i].Item1.TileSpanX) - (padding * (3 - Objects[i].Item1.TileSpanX)); + + int spanY = 1; + int spanX = 1; + + int widthToDraw = (width / spanY) - (padding * 2); + int heightToDraw = (height / spanX) - (padding * 2); + + if (Objects[i].Item1.TextureBase != null) + ParentScene.Main.SpriteBatch.Draw(Objects[i].Item1.TextureBase, + destinationRectangle: new Rectangle(posX + (width - widthToDraw) / 2, (int)Position.Y + posY + (height / 2) - (heightToDraw / 2), widthToDraw, heightToDraw)); ParentScene.Main.SpriteBatch.Draw(Objects[i].Item1.Texture, destinationRectangle: new Rectangle(posX + (width - widthToDraw) / 2, (int)Position.Y + posY + (height / 2) - (heightToDraw / 2), widthToDraw, heightToDraw)); -- cgit v1.2.3-70-g09d2