Ejemplo n.º 1
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)
 {
     currentMouseState = Mouse.GetState();
     if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && quitRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
     {
         Quit();
     }
     if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && nextTurnRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
     {
         int currentTurn = Turn.getCurrentTurn();
         if (currentTurn == Turn.getLastTurn())
         {
             //End Game Component
             this.Visible = false;
             //Score saved
         }
         else
         {
             Turn.setCurrentTurn(currentTurn + 1);
             Souls.endOfTurn();
             NextTurn();
         }
     }
     pastMouseState = currentMouseState;
     base.Update(gameTime);
 }
        public void ResetGameStats()
        {
            List <Zone> zones = MapComponent.GetZones();

            foreach (Zone zone in zones)
            {
                zone.setUpgradeCost(300);
                zone.setTileType(1);
                zone.setNumberOfSouls(0);
            }
            Turn.setCurrentTurn(1);
            PointAndCurency.SetSouls(0);
            PointAndCurency.SetPoints(0);
            PointAndCurency.SetGold(0);
            Souls.souls = new List <Soul>();
        }
Ejemplo n.º 3
0
        public void Quit()
        {
            List <Zone> zones = MapComponent.GetZones();

            foreach (Zone zone in zones)
            {
                zone.setUpgradeCost(300);
                zone.setTileType(1);
                zone.setNumberOfSouls(0);
            }
            Turn.setCurrentTurn(1);
            PointAndCurency.SetSouls(0);
            PointAndCurency.SetPoints(0);
            PointAndCurency.SetGold(0);
            Souls.souls = new List <Soul>();



            quitSession  = true;
            this.Visible = false;
            this.Enabled = false;
        }