/// <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)
        {
            int currentSouls = PointAndCurency.GetSouls();

            currentMouseState = Mouse.GetState();
            if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && sellSoulsButtonPositionRectangle.Contains(currentMouseState.X, currentMouseState.Y))
            {
                if (currentSouls > 0)
                {
                    buttonClick.Play();
                    Souls.sellSoul();
                }
            }
            if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && getPointsButtonPositionRectangle.Contains(currentMouseState.X, currentMouseState.Y))
            {
                if (currentSouls > 0)
                {
                    buttonClick.Play();
                    Souls.scoreSoul();
                }
            }
            if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && buySoulsButtonPositionRectangle.Contains(currentMouseState.X, currentMouseState.Y))
            {
                buttonClick.Play();
                Souls.buySoul();
            }
            pastMouseState = currentMouseState;

            base.Update(gameTime);
        }
Exemple #2
0
        public static void returnSoul(Zone zone)
        {
            int numSouls    = Convert.ToInt32(zone.getNumberOfSouls());
            int soulsOnHand = PointAndCurency.GetSouls();

            if (zone.GetZoneType() >= 2)
            {
                zone.setNumberOfSouls(numSouls + 1);
                PointAndCurency.SetSouls(soulsOnHand - 1);
            }



            /*foreach (var soul in souls)
             * {
             *  if (soul.soulName == "currency")
             *  {
             *      soul.soulName = "alive";
             *      soul.age = 0;
             *      soul.maxAge = random.Next(30, 140);
             *      soul.goodLevel = soul.goodLevel - 2;
             *
             *  }
             * }*/
        }
Exemple #3
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            splashScreen = new SplashScreenGameComponent(this);
            endOfTurnGui = new EndOfTurnGui(this);
            zoneGui = new ZoneGui(this);
            soulGui = new SoulGui(this);
            endTurnButton = new EndTurnButtonComponent(this);
            mapComponent = new MapComponent(this);
            pointSystemComponent = new PointSystemComponent(this);
            newgame = new NewGame(this);
            selectionComponent = new SelectionComponent(this);

            //pointAndCurrency is instantiated
            pointAndCurency = new PointAndCurency();

            //tileMap = new TileMap(this);

            gameManager = new GameManager(this, splashScreen, endTurnButton, zoneGui, soulGui, endOfTurnGui, tileMap, mapComponent, pointSystemComponent, selectionComponent,newgame);

            //tileMap.Visible = false;
            //tileMap.Enabled = false;
            //Components.Add(tileMap);

            pointSystemComponent.Visible = false;
            pointSystemComponent.Enabled = false;
            Components.Add(pointSystemComponent);

            mapComponent.Visible = false;
            mapComponent.Enabled = false;
            Components.Add(mapComponent);

            endTurnButton.Visible = false;
            endTurnButton.Enabled = false;
            Components.Add(endTurnButton); //drawn first to be covered by splash screen since hiding it calls the event handler for endTurn button clicked

            Components.Add(splashScreen);

            endOfTurnGui.Visible = false;
            endOfTurnGui.Enabled = false;
            Components.Add(endOfTurnGui);

            zoneGui.Visible = false;
            zoneGui.Enabled = false;
            Components.Add(zoneGui);

            soulGui.Visible = false;
            soulGui.Enabled = false;
            Components.Add(soulGui);

            selectionComponent.Visible = false;
            selectionComponent.Enabled = false;
            Components.Add(selectionComponent);

            newgame.Visible = false;
            newgame.Enabled = false;
            Components.Add(newgame);
        }
Exemple #4
0
        public static void endOfTurn()
        {
            int points   = PointAndCurency.GetPoints();
            int multiple = 15;

            foreach (var soul in souls)
            {
                if (soul.soulName == "alive")
                {
                    soul.age = soul.age + (1 * multiple);
                    if (soul.age >= soul.maxAge)
                    {
                        soul.soulName = "dead";
                    }
                    else
                    {
                        soul.goodLevel = soul.goodLevel + needCalculation();
                    }
                }
            }
            resourceMangement();
            babySoul();
            points = (int)(points * 1.2);
            PointAndCurency.SetPoints(points);
        }
Exemple #5
0
        public static void endOfGame()
        {
            int currentGold   = PointAndCurency.GetGold();
            int currentPoints = PointAndCurency.GetPoints();

            if (currentGold >= 80)
            {
                currentGold   = currentGold / 80;
                currentPoints = currentPoints + currentGold;
            }
            foreach (var soul in souls)
            {
                if (soul.soulName == "alive")
                {
                    currentPoints = currentPoints + (soul.goodLevel - (soul.maxAge - soul.age));
                    PointAndCurency.SetPoints(currentPoints);
                }
                else if (soul.soulName == "currency")
                {
                    currentPoints = PointAndCurency.GetPoints();
                    currentPoints = currentPoints + (soul.goodLevel / 2);
                    PointAndCurency.SetPoints(currentPoints);
                }
            }
        }
Exemple #6
0
 public void returnSouls()
 {
     if (PointAndCurency.GetSouls() > 0)
     {
         pew.Play();
         Souls.returnSoul(Zone.GetSelectedZone());
     }
 }
Exemple #7
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)
        {
            goldAmount  = PointAndCurency.GetGold().ToString();
            soulAmount  = PointAndCurency.GetSouls().ToString();
            pointAmount = PointAndCurency.GetPoints().ToString();

            base.Update(gameTime);
        }
Exemple #8
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            splashScreen         = new SplashScreenGameComponent(this);
            endOfTurnGui         = new EndOfTurnGui(this);
            zoneGui              = new ZoneGui(this);
            soulGui              = new SoulGui(this);
            endTurnButton        = new EndTurnButtonComponent(this);
            mapComponent         = new MapComponent(this);
            pointSystemComponent = new PointSystemComponent(this);

            selectionComponent = new SelectionComponent(this);

            //pointAndCurrency is instantiated
            pointAndCurency = new PointAndCurency();

            //tileMap = new TileMap(this);

            gameManager = new GameManager(this, splashScreen, endTurnButton, zoneGui, soulGui, endOfTurnGui, tileMap, mapComponent, pointSystemComponent, selectionComponent);

            //tileMap.Visible = false;
            //tileMap.Enabled = false;
            //Components.Add(tileMap);


            pointSystemComponent.Visible = false;
            pointSystemComponent.Enabled = false;
            Components.Add(pointSystemComponent);

            mapComponent.Visible = false;
            mapComponent.Enabled = false;
            Components.Add(mapComponent);

            endTurnButton.Visible = false;
            endTurnButton.Enabled = false;
            Components.Add(endTurnButton); //drawn first to be covered by splash screen since hiding it calls the event handler for endTurn button clicked

            Components.Add(splashScreen);

            endOfTurnGui.Visible = false;
            endOfTurnGui.Enabled = false;
            Components.Add(endOfTurnGui);

            zoneGui.Visible = false;
            zoneGui.Enabled = false;
            Components.Add(zoneGui);

            soulGui.Visible = false;
            soulGui.Enabled = false;
            Components.Add(soulGui);

            selectionComponent.Visible = false;
            selectionComponent.Enabled = false;
            Components.Add(selectionComponent);
        }
Exemple #9
0
 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);
 }
Exemple #10
0
        //To be implemented
        public void NextTurn()
        {
            PointAndCurency.addGold(500);

            List <Zone> zones = new List <Zone>();

            zones = MapComponent.GetZones();

            foreach (Zone zone in zones)
            {
                if (Int32.Parse(zone.getNumberOfSouls()) > 3)
                {
                    if (zone.GetZoneType() == 2)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 2);
                    }
                    if (zone.GetZoneType() == 3)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 4);
                    }
                    if (zone.GetZoneType() == 4)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 7);
                    }
                    if (zone.GetZoneType() == 5)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 10);
                    }
                }
                else
                {
                    if (zone.GetZoneType() != 1)
                    {
                        int oldNumberOfSouls = Int32.Parse(zone.getNumberOfSouls());
                        zone.setNumberOfSouls(oldNumberOfSouls + 1);
                    }
                }
            }


            quitSession  = false;
            this.Visible = false;
            this.Enabled = false;
        }
        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>();
        }
        public override void Update(GameTime gameTime)
        {
            //Get the current keyboard state and keys that are pressed
            keyboardState = Keyboard.GetState();
            Keys[] keys = keyboardState.GetPressedKeys();

            foreach (Keys key in keys)
            {
                if (key == Keys.Back)
                {
                    if (prevKeyboardState.IsKeyUp(key) && keyboardState.IsKeyDown(key))// && keyboardState.IsKeyDown(key))
                    {
                        if (name.Length > 0)
                        {
                            name = name.Remove(name.Length - 1);
                        }
                    }
                }
                else
                {
                    if (prevKeyboardState.IsKeyUp(key) && keyboardState.IsKeyDown(key))// && keyboardState.IsKeyDown(key))
                    {
                        if (key == Keys.A || key == Keys.B || key == Keys.C || key == Keys.D || key == Keys.E || key == Keys.F || key == Keys.G || key == Keys.H || key == Keys.I || key == Keys.J || key == Keys.K || key == Keys.L || key == Keys.M || key == Keys.N || key == Keys.O || key == Keys.P || key == Keys.Q || key == Keys.R || key == Keys.S || key == Keys.T || key == Keys.U || key == Keys.V || key == Keys.W || key == Keys.X || key == Keys.Y || key == Keys.Z)
                        {
                            if (name.Length < 7)
                            {
                                name = name + key;
                            }
                        }
                    }
                }
            }
            prevKeyboardState = keyboardState;

            currentMouseState = Mouse.GetState();
            if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && submitButtonRectanglePosition.Contains(currentMouseState.X, currentMouseState.Y))
            {
                saveHighScore(name, PointAndCurency.GetPoints()); //this must pull out the info from elsewhere.
                ResetGameStats();
                name         = "";
                this.Visible = false;
                this.Enabled = false;
            }
            pastMouseState = currentMouseState;

            base.Update(gameTime);
        }
Exemple #13
0
        public static void scoreSoul(int numSouls)
        {
            int currentPoints = PointAndCurency.GetPoints();
            int currentSouls  = PointAndCurency.GetSouls();
            int selling       = 0;

            foreach (var soul in souls)
            {
                if (soul.soulName == "currency" && selling < numSouls)
                {
                    currentPoints = (currentPoints + soul.goodLevel);
                    //currentSouls = currentSouls - 1;
                    selling++;
                    soul.soulName = "point";
                    PointAndCurency.SetSouls(currentSouls);
                    PointAndCurency.SetPoints(currentPoints);
                }
            }
        }
Exemple #14
0
        public override void Update(GameTime gameTime)
        {
            // TODO: Add your update code here
            currentMouseState = Mouse.GetState();

            if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && easybuttonbuttonrectanglepos.Contains(currentMouseState.X, currentMouseState.Y))
            {
                PointAndCurency.SetGold(10000);
                for (int x = 0; x < 20; x++)
                {
                    Souls.createSoul();
                }
                PointAndCurency.SetSouls(Souls.souls.Count);
                Turn.setDifficulty("easy");
                StartNewGame();
            }
            if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && normalbuttonrectanglepos.Contains(currentMouseState.X, currentMouseState.Y))
            {
                PointAndCurency.SetGold(5000);
                for (int x = 0; x < 15; x++)
                {
                    Souls.createSoul();
                }
                PointAndCurency.SetSouls(Souls.souls.Count);
                Turn.setDifficulty("normal");
                StartNewGame();
            }
            if (currentMouseState.LeftButton == ButtonState.Released && pastMouseState.LeftButton == ButtonState.Pressed && expertbuttonrectanglepos.Contains(currentMouseState.X, currentMouseState.Y))
            {
                PointAndCurency.SetGold(3000);
                for (int x = 0; x < 10; x++)
                {
                    Souls.createSoul();
                }
                PointAndCurency.SetSouls(Souls.souls.Count);
                Turn.setDifficulty("hard");
                StartNewGame();
            }
            pastMouseState = currentMouseState;
            base.Update(gameTime);
        }
Exemple #15
0
        public static void sellSoul()
        {
            int currentGold  = PointAndCurency.GetGold();
            int currentSouls = PointAndCurency.GetSouls();
            int selling      = 0;
            int soulID       = 0;

            foreach (var soul in souls)
            {
                if (soul.soulName == "currency" && selling == 0)
                {
                    currentSouls = currentSouls - 1;
                    currentGold  = currentGold + 75;
                    selling++;
                    soul.soulName = "sold";
                    PointAndCurency.SetSouls(currentSouls);
                    PointAndCurency.SetGold(currentGold);
                    soul.soulNumber = soulID;
                }
            }
        }
Exemple #16
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;
        }
Exemple #17
0
        protected override void LoadContent()
        {
            //values for strings
            pointAndCurency = new PointAndCurency();
            goldAmount      = PointAndCurency.GetGold().ToString();
            soulAmount      = PointAndCurency.GetSouls().ToString();
            pointAmount     = PointAndCurency.GetPoints().ToString();

            //setting position of strings holding currency values
            goldStringPosition  = new Vector2(330, 17);
            soulStringPosition  = new Vector2(440, 17);
            pointStringPosition = new Vector2(620, 17);

            spriteBatch = new SpriteBatch(GraphicsDevice);
            //Loading textures
            goldCurrencyTexture       = Game.Content.Load <Texture2D>(@"sprites\goldCurrency");
            soulCurrencyTexture       = Game.Content.Load <Texture2D>(@"sprites\soulCurrency");
            pointCurrencyTexture      = Game.Content.Load <Texture2D>(@"sprites\pointCurrency");
            currencyContainterTexture = Game.Content.Load <Texture2D>(@"sprites\currencyContainer");

            //loading Fonts
            spriteFont = Game.Content.Load <SpriteFont>(@"fonts\CourierNew");

            currencyContainerDrawableRectangle = new Rectangle(0, 0, currencyContainterTexture.Bounds.Width, currencyContainterTexture.Bounds.Height);
            goldCurrencyDrawableRectangle      = new Rectangle(0, 0, goldCurrencyTexture.Bounds.Width, goldCurrencyTexture.Bounds.Height);
            soulCurrencyDrawableRectangle      = new Rectangle(0, 0, soulCurrencyTexture.Bounds.Width, soulCurrencyTexture.Bounds.Height);
            pointCurrencyDrawableRectangle     = new Rectangle(0, 0, pointCurrencyTexture.Bounds.Width, pointCurrencyTexture.Bounds.Height);

            //+200 is sending the whole component to the right
            currencyContainerPositionRectangle = new Rectangle(0 + 250, 0, currencyContainterTexture.Bounds.Width / 2, currencyContainterTexture.Bounds.Height / 2);
            goldCurrencyPositionRectangle      = new Rectangle(10 + 250, 10, goldCurrencyTexture.Bounds.Width / 2, goldCurrencyTexture.Bounds.Height / 2);
            soulCurrencyPositionRectangle      = new Rectangle(130 + 250, 10, soulCurrencyTexture.Bounds.Width / 2, soulCurrencyTexture.Bounds.Height / 2);
            pointCurrencyPositionRectangle     = new Rectangle(250 + 250, 15, pointCurrencyTexture.Bounds.Width / 2, pointCurrencyTexture.Bounds.Height / 2);

            //Loading Fonts


            base.LoadContent();
        }
Exemple #18
0
        public static void buySoul()
        {
            int currentGold  = PointAndCurency.GetGold();
            int currentSouls = PointAndCurency.GetSouls();

            if (currentGold >= 100)
            {
                currentGold  = currentGold - 100;
                currentSouls = currentSouls + 1;
                PointAndCurency.SetSouls(currentSouls);
                PointAndCurency.SetGold(currentGold);
                allSoul++;
                souls.Add(new Soul
                {
                    soulNumber = allSoul,
                    soulName   = "currency",
                    age        = 0,
                    maxAge     = random.Next(30, 140),
                    goodLevel  = random.Next(-10, 35),
                    tileID     = 0
                });
            }
        }
Exemple #19
0
        public void Upgrade()
        {
            if (zoneType == 1)
            {
                if (PointAndCurency.GetGold() > 300)
                {
                    PointAndCurency.subtractGold(300);
                    zoneType = zoneType + 1;
                }
            }
            else if (zoneType == 2)
            {
                if (PointAndCurency.GetGold() > 500)
                {
                    PointAndCurency.subtractGold(500);
                    zoneType = zoneType + 1;
                }
            }
            else if (zoneType == 3)
            {
                if (PointAndCurency.GetGold() > 700)
                {
                    PointAndCurency.subtractGold(700);
                    zoneType = zoneType + 1;
                }
            }
            else if (zoneType == 4)
            {
                if (PointAndCurency.GetGold() > 1000)
                {
                    PointAndCurency.subtractGold(1000);
                    zoneType = zoneType + 1;
                }
            }

            //if (zoneType == (int)ZoneStates.Water)
            //{
            //    //(If player has enough money resources) then do rest        // To be implemented
            //    //{
            //    zoneType = (int)ZoneStates.Earth;
            //    //}
            //}
            //if (zoneType == (int)ZoneStates.Earth)
            //{
            //    //(If player has enough money resources) then do rest        // To be implemented
            //    //{
            //    zoneType = (int)ZoneStates.Village;
            //    //}
            //}
            //if (zoneType == (int)ZoneStates.Village)
            //{
            //    //(If player has enough money resources) then do rest        // To be implemented
            //    //{
            //    zoneType = (int)ZoneStates.Town;
            //    //}
            //}
            //if (zoneType == (int)ZoneStates.Town)
            //{
            //    //(If player has enough money resources) then do rest        // To be implemented
            //    //{
            //    zoneType = (int)ZoneStates.City;
            //    //}
            //}
            //if (zoneType == (int)ZoneStates.City)
            //{
            //    //Message that zone is not upgradable any further
            //}
        }
        protected override void LoadContent()
        {
            pointAndCurency = new PointAndCurency();
            goldAmount = PointAndCurency.GetGold().ToString();
            soulAmount = PointAndCurency.GetSouls().ToString();
            pointAmount = PointAndCurency.GetPoints().ToString();

            //setting position of strings holding currency values
            goldStringPosition = new Vector2(330, 17);
            soulStringPosition = new Vector2(440, 17);
            pointStringPosition = new Vector2(620, 17);

            spriteBatch = new SpriteBatch(GraphicsDevice);
            //Loading textures
            goldCurrencyTexture = Game.Content.Load<Texture2D>(@"sprites\goldCurrency");
            soulCurrencyTexture = Game.Content.Load<Texture2D>(@"sprites\soulCurrency");
            pointCurrencyTexture = Game.Content.Load<Texture2D>(@"sprites\pointCurrency");
            currencyContainterTexture = Game.Content.Load<Texture2D>(@"sprites\currencyContainer");

            //loading Fonts
            spriteFont = Game.Content.Load<SpriteFont>(@"fonts\CourierNew");

            currencyContainerDrawableRectangle = new Rectangle(0,0, currencyContainterTexture.Bounds.Width, currencyContainterTexture.Bounds.Height);
            goldCurrencyDrawableRectangle = new Rectangle(0, 0, goldCurrencyTexture.Bounds.Width, goldCurrencyTexture.Bounds.Height);
            soulCurrencyDrawableRectangle = new Rectangle(0, 0, soulCurrencyTexture.Bounds.Width, soulCurrencyTexture.Bounds.Height);
            pointCurrencyDrawableRectangle = new Rectangle(0, 0, pointCurrencyTexture.Bounds.Width, pointCurrencyTexture.Bounds.Height);

            //+200 is sending the whole component to the right
            currencyContainerPositionRectangle = new Rectangle(0 + 250, 0, currencyContainterTexture.Bounds.Width /2, currencyContainterTexture.Bounds.Height /2);
            goldCurrencyPositionRectangle = new Rectangle(10 + 250, 10, goldCurrencyTexture.Bounds.Width / 2, goldCurrencyTexture.Bounds.Height / 2);
            soulCurrencyPositionRectangle = new Rectangle(130 + 250, 10, soulCurrencyTexture.Bounds.Width / 2, soulCurrencyTexture.Bounds.Height / 2);
            pointCurrencyPositionRectangle = new Rectangle(250 + 250, 15, pointCurrencyTexture.Bounds.Width / 2, pointCurrencyTexture.Bounds.Height / 2);

            //Loading Fonts

            base.LoadContent();
        }
Exemple #21
0
        public override void Draw(GameTime gameTime)
        {
            spriteBatch.Begin();
            spriteBatch.Draw(resultscreen, resultRectanglePosition, resultRectangle, Color.White);
            spriteBatch.DrawString(spriteFont1, "Congratulations you're done the game, your final score is: " + PointAndCurency.GetPoints(), new Vector2(65, 450), Color.White);

            spriteBatch.End();
            base.Draw(gameTime);
        }
Exemple #22
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            splashScreen = new SplashScreenGameComponent(this);
            endOfTurnGui = new EndOfTurnGui(this);
            zoneGui = new ZoneGui(this);
            soulGui = new SoulGui(this);
            endTurnButton = new EndTurnButtonComponent(this);
            mapComponent = new MapComponent(this);
            pointSystemComponent = new PointSystemComponent(this);
            newgame = new NewGame(this);
            selectionComponent = new SelectionComponent(this);
            difficulty = new Difficulty(this);
            //pointAndCurrency is instantiated
            pointAndCurency = new PointAndCurency();
            currencyController = new CurrencyControllerComponent(this);
            turnComponent = new TurnComponent(this);
            instructions = new InstructionsGui(this);
            resultscreen = new ResultScreen(this);
            highScoreComponent = new HighScoresComponent(this);
            scoreSubmissionBoxComponent = new ScoreSubmissionBoxComponent(this);

            //tileMap = new TileMap(this);

            gameManager = new GameManager(this, splashScreen, endTurnButton, zoneGui, soulGui, endOfTurnGui, tileMap, mapComponent, pointSystemComponent, selectionComponent, newgame, difficulty, currencyController, turnComponent, instructions, resultscreen, highScoreComponent, scoreSubmissionBoxComponent);

            //tileMap.Visible = false;
            //tileMap.Enabled = false;
            //Components.Add(tileMap);

            pointSystemComponent.Visible = false;
            pointSystemComponent.Enabled = false;
            Components.Add(pointSystemComponent);

            mapComponent.Visible = false;
            mapComponent.Enabled = false;
            Components.Add(mapComponent);

            endTurnButton.Visible = false;
            endTurnButton.Enabled = false;
            Components.Add(endTurnButton); //drawn first to be covered by splash screen since hiding it calls the event handler for endTurn button clicked

            Components.Add(splashScreen);

            endOfTurnGui.Visible = false;
            endOfTurnGui.Enabled = false;
            Components.Add(endOfTurnGui);

            zoneGui.Visible = false;
            zoneGui.Enabled = false;
            Components.Add(zoneGui);

            soulGui.Visible = false;
            soulGui.Enabled = false;
            Components.Add(soulGui);

            selectionComponent.Visible = false;
            selectionComponent.Enabled = false;
            Components.Add(selectionComponent);

            newgame.Visible = false;
            newgame.Enabled = false;
            Components.Add(newgame);

            difficulty.Visible = false;
            difficulty.Enabled = false;
            Components.Add(difficulty);

            currencyController.Visible = false;
            currencyController.Enabled = false;
            Components.Add(currencyController);

            turnComponent.Visible = false;
            turnComponent.Enabled = false;
            Components.Add(turnComponent);

            instructions.Visible = false;
            instructions.Enabled = false;
            Components.Add(instructions);

            resultscreen.Visible = false;
            resultscreen.Enabled = false;
            Components.Add(resultscreen);

            highScoreComponent.Visible = false;
            highScoreComponent.Enabled = true;
            Components.Add(highScoreComponent);

            scoreSubmissionBoxComponent.Visible = false;
            scoreSubmissionBoxComponent.Enabled = false;
            Components.Add(scoreSubmissionBoxComponent);
        }
Exemple #23
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            splashScreen         = new SplashScreenGameComponent(this);
            endOfTurnGui         = new EndOfTurnGui(this);
            zoneGui              = new ZoneGui(this);
            soulGui              = new SoulGui(this);
            endTurnButton        = new EndTurnButtonComponent(this);
            mapComponent         = new MapComponent(this);
            pointSystemComponent = new PointSystemComponent(this);
            newgame              = new NewGame(this);
            selectionComponent   = new SelectionComponent(this);
            difficulty           = new Difficulty(this);
            //pointAndCurrency is instantiated
            pointAndCurency             = new PointAndCurency();
            currencyController          = new CurrencyControllerComponent(this);
            turnComponent               = new TurnComponent(this);
            instructions                = new InstructionsGui(this);
            resultscreen                = new ResultScreen(this);
            highScoreComponent          = new HighScoresComponent(this);
            scoreSubmissionBoxComponent = new ScoreSubmissionBoxComponent(this);

            //tileMap = new TileMap(this);

            gameManager = new GameManager(this, splashScreen, endTurnButton, zoneGui, soulGui, endOfTurnGui, tileMap, mapComponent, pointSystemComponent, selectionComponent, newgame, difficulty, currencyController, turnComponent, instructions, resultscreen, highScoreComponent, scoreSubmissionBoxComponent);

            //tileMap.Visible = false;
            //tileMap.Enabled = false;
            //Components.Add(tileMap);


            pointSystemComponent.Visible = false;
            pointSystemComponent.Enabled = false;
            Components.Add(pointSystemComponent);

            mapComponent.Visible = false;
            mapComponent.Enabled = false;
            Components.Add(mapComponent);

            endTurnButton.Visible = false;
            endTurnButton.Enabled = false;
            Components.Add(endTurnButton); //drawn first to be covered by splash screen since hiding it calls the event handler for endTurn button clicked

            Components.Add(splashScreen);

            endOfTurnGui.Visible = false;
            endOfTurnGui.Enabled = false;
            Components.Add(endOfTurnGui);

            zoneGui.Visible = false;
            zoneGui.Enabled = false;
            Components.Add(zoneGui);

            soulGui.Visible = false;
            soulGui.Enabled = false;
            Components.Add(soulGui);

            selectionComponent.Visible = false;
            selectionComponent.Enabled = false;
            Components.Add(selectionComponent);

            newgame.Visible = false;
            newgame.Enabled = false;
            Components.Add(newgame);

            difficulty.Visible = false;
            difficulty.Enabled = false;
            Components.Add(difficulty);

            currencyController.Visible = false;
            currencyController.Enabled = false;
            Components.Add(currencyController);

            turnComponent.Visible = false;
            turnComponent.Enabled = false;
            Components.Add(turnComponent);

            instructions.Visible = false;
            instructions.Enabled = false;
            Components.Add(instructions);

            resultscreen.Visible = false;
            resultscreen.Enabled = false;
            Components.Add(resultscreen);

            highScoreComponent.Visible = false;
            highScoreComponent.Enabled = true;
            Components.Add(highScoreComponent);

            scoreSubmissionBoxComponent.Visible = false;
            scoreSubmissionBoxComponent.Enabled = false;
            Components.Add(scoreSubmissionBoxComponent);
        }
Exemple #24
0
        public void Upgrade()
        {
            if (zoneType == 1)
            {
                if (PointAndCurency.GetGold() >= 300) //cost 300
                {
                    PointAndCurency.subtractGold(300);
                    zoneType    = zoneType + 1;
                    upgradeCost = 500; //new cost
                    //numberOfSouls = 50;
                    for (int x = 0; x < numberOfSouls; x++)
                    {
                        Souls.createSoul();
                    }
                }
            }
            else if (zoneType == 2)
            {
                if (PointAndCurency.GetGold() >= 500) //cost 500
                {
                    PointAndCurency.subtractGold(500);
                    zoneType    = zoneType + 1;
                    upgradeCost = 700; //new cost
                    //numberOfSouls = numberOfSouls + 50;
                    for (int x = 0; x < 50; x++)
                    {
                        Souls.createSoul();
                    }
                }
            }
            else if (zoneType == 3)
            {
                if (PointAndCurency.GetGold() >= 700) //cost 700
                {
                    PointAndCurency.subtractGold(700);
                    zoneType    = zoneType + 1;
                    upgradeCost = 1000; //new cost
                    //numberOfSouls = numberOfSouls + 25;
                    for (int x = 0; x < 25; x++)
                    {
                        Souls.createSoul();
                    }
                }
            }
            else if (zoneType == 4)
            {
                if (PointAndCurency.GetGold() >= 1000) //cost 1000
                {
                    PointAndCurency.subtractGold(1000);
                    zoneType    = zoneType + 1;
                    upgradeCost = 0; //new cost
                    //numberOfSouls = numberOfSouls + 25;
                    for (int x = 0; x < 25; x++)
                    {
                        Souls.createSoul();
                    }
                }
            }

            //if (zoneType == (int)ZoneStates.Water)
            //{
            //    //(If player has enough money resources) then do rest        // To be implemented
            //    //{
            //    zoneType = (int)ZoneStates.Earth;
            //    //}
            //}
            //if (zoneType == (int)ZoneStates.Earth)
            //{
            //    //(If player has enough money resources) then do rest        // To be implemented
            //    //{
            //    zoneType = (int)ZoneStates.Village;
            //    //}
            //}
            //if (zoneType == (int)ZoneStates.Village)
            //{
            //    //(If player has enough money resources) then do rest        // To be implemented
            //    //{
            //    zoneType = (int)ZoneStates.Town;
            //    //}
            //}
            //if (zoneType == (int)ZoneStates.Town)
            //{
            //    //(If player has enough money resources) then do rest        // To be implemented
            //    //{
            //    zoneType = (int)ZoneStates.City;
            //    //}
            //}
            //if (zoneType == (int)ZoneStates.City)
            //{
            //    //Message that zone is not upgradable any further
            //}
        }