diff options
Diffstat (limited to 'Penguloon/Controls')
| -rw-r--r-- | Penguloon/Controls/ObjectSelector.cs | 17 |
1 files changed, 14 insertions, 3 deletions
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<ObjectBase,int>(new PenguinObject(Map), 250)); Objects.Add(new Tuple<ObjectBase, int>(new GoldPenguinObject(Map), 360)); Objects.Add(new Tuple<ObjectBase, int>(new CannonObject(Map), 650)); - Objects.Add(new Tuple<ObjectBase, int>(new HealthGeneratorObject(Map), 150)); + Objects.Add(new Tuple<ObjectBase, int>(new HealthGeneratorObject(Map), 800)); + Objects.Add(new Tuple<ObjectBase, int>(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)); |
