public override void Update(GameTime gameTime) { zoneSelected = Zone.GetSelectedZone(); if (zoneSelected == null) { this.Visible = false; this.Enabled = true; } else { //Getting Zone Information idString = zoneSelected.getZoneIDString(); typeString = zoneSelected.getZoneName(zoneSelected.GetZoneType()); //get zone type int.. give it to the GetZoneName and receive string with name of zone type upgradeCostString = zoneSelected.getUpgradeCost(); this.Visible = true; this.Enabled = true; currentMouseState = Mouse.GetState(); if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && cashSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y)) { CashSouls(); } if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && upgradeRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y)) { Upgrade(Zone.GetSelectedZone()); } pastMouseState = currentMouseState; } base.Update(gameTime); }
public void returnSouls() { if (PointAndCurency.GetSouls() > 0) { pew.Play(); Souls.returnSoul(Zone.GetSelectedZone()); } }
public void CashSouls() { if ((Convert.ToInt32(Zone.GetSelectedZone().getNumberOfSouls()) > 0)) { ohNo.Play(); } PointAndCurency.addSouls(Int32.Parse(Zone.GetSelectedZone().getNumberOfSouls())); //Souls.scoreSoul(Convert.ToInt32(Zone.GetSelectedZone().getNumberOfSouls())); Zone.GetSelectedZone().setNumberOfSouls(0); }
/// <summary> /// Allows the game component to update itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> public override void Update(GameTime gameTime) { foreach (Zone zone in zones) { if (zone.Equals(Zone.GetSelectedZone())) { selectionPositionRectangle = zone.GetPosition(); } } base.Update(gameTime); }
public override void Update(GameTime gameTime) { currentMouseState = Mouse.GetState(); if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && cashSoulsRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y)) { CashSouls(); } if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && upgradeRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y)) { Upgrade(Zone.GetSelectedZone()); } pastMouseState = currentMouseState; base.Update(gameTime); }