Beispiel #1
0
        public void LoadContent(ContentManager content, GameObjects Obj)
        {
            foreach (GUIElement element in main)
            {
                element.LoadContent(content, Obj);
                element.clickEvent += OnClick;
            }
            main.Find(x => x.AssetName == "Main-Menu/Background").PutBg();

            main.Find(x => x.AssetName == "Main-Menu/MAS-background").moveElement(0, 10);
            main.Find(x => x.AssetName == "Main-Menu/play").moveElement(730, 835);
            main.Find(x => x.AssetName == "Main-Menu/Settings").moveElement(550, 850);
            main.Find(x => x.AssetName == "Main-Menu/leaderboard").moveElement(1200, 850);
        }
Beispiel #2
0
 public Calamares(int restoLevel, GameObjects obj, int next)
 {
     //Tijd =(SOM(resources)/2)*2,25
     Time = ((totalResource / 2) * (2.25 - (restoLevel * 0.15))) + 1;
     if (next > (int)obj.gameTime.TotalGameTime.TotalSeconds)
     {
         this.endTick = next + (int)TimeSpan.FromSeconds(Time).TotalSeconds + 1;
     }
     else
     {
         this.endTick = (int)obj.gameTime.TotalGameTime.TotalSeconds + (int)TimeSpan.FromSeconds(Time).TotalSeconds;
     }
     obj.Fish -= 5;
 }
Beispiel #3
0
 public void Update(GameObjects gameObjects)
 {
     foreach (GUIElement element in Settings)
     {
         if (element.AssetName == "settings/music-on" && gameObjects.Music)
         {
             element.Update(gameObjects);
         }
         if (element.AssetName == "settings/music-off" && gameObjects.Music == false)
         {
             element.Update(gameObjects);
         }
         element.Update(gameObjects);
     }
 }
Beispiel #4
0
 public HerbCake(int restoLevel, GameObjects obj, int next)
 {
     //Tijd =(SOM(resources)/2)*2,25
     Time = ((totalResource / 2) * (2.25 - (restoLevel * 0.15))) + 1;
     if (next > (int)obj.gameTime.TotalGameTime.TotalSeconds)
     {
         this.endTick = next + (int)TimeSpan.FromSeconds(Time).TotalSeconds + 1;
     }
     else
     {
         this.endTick = (int)obj.gameTime.TotalGameTime.TotalSeconds + (int)TimeSpan.FromSeconds(Time).TotalSeconds;
     }
     obj.Grains -= 10;
     obj.Vegies -= 10;
 }
Beispiel #5
0
        public void Update(GameObjects gameObjects)
        {
            switch (screen)
            {
            case screens.Screen1:
                foreach (GUIElement element in Screen1)
                {
                    element.Update(gameObjects);
                }
                break;

            case screens.Screen2:
                foreach (GUIElement element in Screen2)
                {
                    element.Update(gameObjects);
                }

                break;

            case screens.Attack:
                foreach (GUIElement element in Attack)
                {
                    element.Update(gameObjects);
                }
                break;

            case screens.DetailBunny:
                foreach (GUIElement element in detailBunny)
                {
                    element.Update(gameObjects);
                }
                break;

            default:
                break;
            }
            if (screen == screens.Screen2 || screen == screens.Screen1)
            {
                if (gameObjects.touchInput.swippedLeft)
                {
                    screen = screens.Screen2;
                }
                if (gameObjects.touchInput.swippedRight)
                {
                    screen = screens.Screen1;
                }
            }
        }
Beispiel #6
0
        public void Update(GameObjects gameObjects)
        {
            switch (screen)
            {
            case Screens.choose:
                foreach (GUIElement element in choose)
                {
                    element.Update(gameObjects);
                }
                break;

            case Screens.Rhiz:
                foreach (GUIElement element in rhizome)
                {
                    element.Update(gameObjects);
                }
                break;

            case Screens.Trans:
                foreach (GUIElement element in transhumania)
                {
                    element.Update(gameObjects);
                }
                break;

            case Screens.Aug:
                foreach (GUIElement element in augmenturia)
                {
                    element.Update(gameObjects);
                }
                break;

            default:
                break;
            }
            if (kies)
            {
                gameObjects.Gekozen = true;
            }
            if (screen != Screens.choose)
            {
                if (gameObjects.touchInput.swippedRight)
                {
                    screen = Screens.choose;
                }
            }
        }
Beispiel #7
0
        public void Upgradelvl(GameObjects Presource)
        {
            //=100*Level
            if (Presource.Money >= (((80 * (wastelevel + 1)) * 2)))
            {
                Presource.Money = Presource.Money - (((80 * (wastelevel + 1)) * 2));
                double W = 400 * Math.Pow((1 + 0.45), wastelevel);
                maxBio  = (int)((3 / 5) * W);
                maxChem = (int)((2 / 5) * W);

                wastelevel++;
            }
            else
            {
                acties = Acties.error;
            }
        }
Beispiel #8
0
        public void update(GameTime gameTime, DrawResto resto, GameObjects obj)
        {
            int index = 0;

            foreach (BaseFood f in resto.food)
            {
                if (f.endTick < (int)gameTime.TotalGameTime.TotalSeconds)
                {
                    obj.Money += f.Money;
                    obj.XP    += f.Experience;
                    obj.waste += f.Waste;
                    index      = resto.food.IndexOf(f);
                    resto.food.RemoveAt(index);
                    return;
                }
            }
        }
Beispiel #9
0
 public void Update(GameObjects gameObjects)
 {
     foreach (GUIElement element in farm)
     {
         element.Update(gameObjects);
     }
     if (acties == Acties.Upgrade)
     {
         acties = Acties.main;
         Upgradelvl(gameObjects);
     }
     if (acties == Acties.error)
     {
         error.Update(gameObjects);
     }
     gameObjects.amountTiles = totalTiles;
 }
Beispiel #10
0
 public void Upgradelvl(GameObjects Presource)
 {
     //=100*Level
     if (Presource.Money >= ((FarmLevel + 1) * 100))
     {
         Presource.Money -= ((FarmLevel + 1) * 100);
         FarmLevel++;
         tottiles += 3;
         meatTile++;
         vegieTile++;
         grainTile++;
     }
     else
     {
         acties = Acties.error;
     }
 }
Beispiel #11
0
        public BBQ(int restoLevel, GameObjects obj, int next)
        {
            //Tijd =(SOM(resources)/2)*2,25

            Time = ((totalResource / 2) * (2.25 - (restoLevel * 0.15))) + 1;
            if (next > (int)obj.gameTime.TotalGameTime.TotalSeconds)
            {
                this.endTick = next + (int)TimeSpan.FromSeconds(Time).TotalSeconds + 1;
            }
            else
            {
                this.endTick = (int)obj.gameTime.TotalGameTime.TotalSeconds + (int)TimeSpan.FromSeconds(Time).TotalSeconds;
            }
            obj.Meat -= 5;
            Console.WriteLine("eind");
            Console.WriteLine(endTick);
        }
Beispiel #12
0
        public void LoadContent(ContentManager content, GameObjects gameObjects)
        {
            foreach (GUIElement element in Settings)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }
            Settings.Find(x => x.AssetName == "Main-Menu/MAS-background").PutBg();
            Settings.Find(x => x.AssetName == "settings/settings-bg").moveElement(65, 25);
            Settings.Find(x => x.AssetName == "settings/contact").moveElement(985, 595);
            Settings.Find(x => x.AssetName == "settings/music-on").moveElement(985, 400);
            Settings.Find(x => x.AssetName == "settings/english").moveElement(175, 595);
            Settings.Find(x => x.AssetName == "settings/sound-on").moveElement(175, 400);
            Settings.Find(x => x.AssetName == "settings/facebook").moveElement(660, 815);


            Settings.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1740, 65);
        }
        public void LoadContent(ContentManager content, GameObjects gameObjects)
        {
            foreach (GUIElement element in faction)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }

            faction.Find(x => x.AssetName == "Factions/factions bg").PutBg();
            faction.Find(x => x.AssetName == "Factions/augmentulitaria").moveElement(845, 170);
            faction.Find(x => x.AssetName == "Factions/rhizome").moveElement(1330, 250);
            faction.Find(x => x.AssetName == "Factions/transhumania").moveElement(410, 250);
            faction.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1750, 65);

            foreach (GUIElement element in Screen1)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }

            Screen1.Find(x => x.AssetName == "Factions/factions bg").PutBg();
            Screen1.Find(x => x.AssetName == "Factions/augmentulitaria-screen").PutBg();
            Screen1.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1710, 220);

            foreach (GUIElement element in Screen2)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }

            Screen2.Find(x => x.AssetName == "Factions/factions bg").PutBg();
            Screen2.Find(x => x.AssetName == "Factions/rhizome-screen").PutBg();
            Screen2.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1710, 220);

            foreach (GUIElement element in Screen3)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }

            Screen3.Find(x => x.AssetName == "Factions/factions bg").PutBg();
            Screen3.Find(x => x.AssetName == "Factions/transhumania-screen").PutBg();
            Screen3.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1710, 220);
        }
Beispiel #14
0
 public void fillProp(GameTime gameTime, DrawFarm farm, DrawHarbour harbour, GameObjects gameObjects, DrawMarket market)
 {
     if (gameObjects.TotalRecource <= market.Storage)
     {
         if (Math.Round(gameTime.TotalGameTime.TotalSeconds, 2) % 12 == 0)
         {
             gameObjects.Grains += farm.GrainTile;
             gameObjects.Vegies += farm.VegieTile;
         }
         if (Math.Round(gameTime.TotalGameTime.TotalSeconds, 2) % 24 == 0)
         {
             gameObjects.Meat += farm.MeatTile;
         }
         if (Math.Round(gameTime.TotalGameTime.TotalSeconds, 2) % 60 == 0)
         {
             gameObjects.Chemwaste += (int)((1 / 5) * (farm.GrainTile * 5));
             gameObjects.Chemwaste += (int)((1 / 5) * (farm.VegieTile * 5));
             gameObjects.Chemwaste += (int)((1 / 5) * (farm.MeatTile * 5));
         }
         if (Math.Round(gameTime.TotalGameTime.TotalSeconds, 2) % 120 == 0)
         {
             gameObjects.Fish      += (harbour.ShipCapacity * harbour.AmountOfShips);
             gameObjects.Chemwaste += (int)(1 / 5) * (harbour.ShipCapacity * harbour.AmountOfShips);
             gameObjects.waste     -= gameObjects.amountTiles;
         }
         gameObjects.TotalRecource = gameObjects.Grains + gameObjects.Fish + gameObjects.Meat + gameObjects.Vegies;
     }
     else
     {
         if (Math.Round(gameTime.TotalGameTime.TotalSeconds, 2) % 12 == 0)
         {
             gameObjects.waste += farm.GrainTile;
             gameObjects.waste += farm.VegieTile;
         }
         if (Math.Round(gameTime.TotalGameTime.TotalSeconds, 2) % 24 == 0)
         {
             gameObjects.waste += farm.MeatTile;
         }
         if (Math.Round(gameTime.TotalGameTime.TotalSeconds, 2) % 120 == 0)
         {
             gameObjects.waste += (harbour.ShipCapacity * harbour.AmountOfShips);
         }
     }
 }
Beispiel #15
0
        public void LoadContent(ContentManager content, GameObjects gameObjects)
        {
            font = content.Load <SpriteFont> ("MyFont");

            foreach (GUIElement element in farm)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }
            farm.Find(x => x.AssetName == "Cross-Screen/Island-bg").PutBg();
            farm.Find(x => x.AssetName == "Cross-Screen/upgrade").moveElement(135, 750);
            farm.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1750, 65);
            farm.Find(x => x.AssetName == "Farm/Place-tiles").moveElement(1560, 750);

            farm.Find(x => x.AssetName == "Farm/bar-speed").moveElement(458, 844);
            farm.Find(x => x.AssetName == "Farm/bar-level").moveElement(1026, 849);
            error.LoadContent(content, gameObjects);
            gameObjects.amountTiles = totalTiles;
        }
Beispiel #16
0
        public void Update(GameObjects gameObjects)
        {
            switch (vragen)
            {
            case Acties.vraag:
                quest.Update(gameObjects);
                if (quest.Vraag1)
                {
                    vragen = Acties.main;
                    gameObjects.cluster3 = true;
                }
                break;

            case Acties.main:
                foreach (GUIElement element in resto)
                {
                    element.Update(gameObjects);
                    if (element.AssetName == "Resto/bar-speed")
                    {
                        if (food.Count != 0)
                        {
                            element.drawParial((int)(food.ElementAt(0).endTick - gameObjects.gameTime.TotalGameTime.TotalSeconds), (int)food.ElementAt(0).Time);
                        }
                    }
                    if (element.AssetName == "Resto/bar-upgrade")
                    {
                        element.drawParial((RestoLevel + 1), 16);
                    }
                    if (acties == Acties.error)
                    {
                        error.Update(gameObjects);
                    }
                }
                obj = gameObjects;
                break;

            default:
                break;
            }
        }
Beispiel #17
0
        public void Update(GameObjects gameObjects)
        {
            switch (screens)
            {
            case Screen.Cluster_1I:
                foreach (GUIElement element in intro)
                {
                    element.Update(gameObjects);
                }
                break;

            case Screen.Cluster_1Q:
                foreach (GUIElement element in question)
                {
                    element.Update(gameObjects);
                }
                break;

            case Screen.Cluster_1E:
                foreach (GUIElement element in end)
                {
                    element.Update(gameObjects);
                }
                break;

            default:
                break;
            }
            if (screens == Screen.Cluster_1Q || screens == Screen.Cluster_1I)
            {
                if (gameObjects.touchInput.swippedLeft)
                {
                    screens = Screen.Cluster_1Q;
                }
                if (gameObjects.touchInput.swippedRight)
                {
                    screens = Screen.Cluster_1I;
                }
            }
        }
Beispiel #18
0
        public void LoadContent(ContentManager content, GameObjects gameObjects)
        {
            font = content.Load <SpriteFont> ("MyFont");
            quest.LoadContent(content, gameObjects);
            if (quest.Vraag1 == false)
            {
                vragen = Acties.vraag;
                gameObjects.cluster3 = false;
            }
            foreach (GUIElement element in resto)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }
            resto.Find(x => x.AssetName == "Cross-Screen/Island-bg").PutBg();
            resto.Find(x => x.AssetName == "Resto/resto-bg").moveElement(65, 25);

            resto.Find(x => x.AssetName == "Cross-Screen/upgrade-small").moveElement(830, 820);
            resto.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1750, 65);

            resto.Find(x => x.AssetName == "Resto/down").moveElement(1735, 625);
            resto.Find(x => x.AssetName == "Resto/up").moveElement(1735, 260);

            resto.Find(x => x.AssetName == "Resto/prepare-46points").moveElement(645, 260);
            resto.Find(x => x.AssetName == "Resto/preapare-60points-blue").moveElement(645, 380);
            resto.Find(x => x.AssetName == "Resto/prepare-40pints-blue").moveElement(645, 500);
            resto.Find(x => x.AssetName == "Resto/prepare-10points-blue").moveElement(645, 620);

            resto.Find(x => x.AssetName == "Resto/prepare-50points").moveElement(1475, 260);
            resto.Find(x => x.AssetName == "Resto/prepare-10points-orange").moveElement(1475, 380);
            resto.Find(x => x.AssetName == "Resto/prepare-10points-orange1").moveElement(1475, 500);
            resto.Find(x => x.AssetName == "Resto/prepare-40points-orange").moveElement(1475, 620);


            resto.Find(x => x.AssetName == "Resto/bar-speed").moveElement(198, 874);
            resto.Find(x => x.AssetName == "Resto/bar-upgrade").moveElement(1138, 875);
            error.LoadContent(content, gameObjects);
        }
Beispiel #19
0
        public void LoadContent(ContentManager content, GameObjects Obj)
        {
            font = content.Load <SpriteFont> ("MyFont");
            choose.LoadContent(content, Obj);

            foreach (GUIElement element in mainBuildings)
            {
                element.LoadContent(content, Obj);
                element.clickEvent += OnClick;
            }
            mainBuildings.Find(x => x.AssetName == "Main-Game/island").PutBg();

            mainBuildings.Find(x => x.AssetName == "Main-Game/money-button").moveElement(50, 50);
            mainBuildings.Find(x => x.AssetName == "Main-Game/Xp-Level").moveElement(350, 50);
            mainBuildings.Find(x => x.AssetName == "Main-Game/settings").moveElement(1700, 50);

            mainBuildings.Find(x => x.AssetName == "Main-Game/barracks").moveElement(850, 100);
            mainBuildings.Find(x => x.AssetName == "Main-Game/Flag").moveElement(450, 220);
            mainBuildings.Find(x => x.AssetName == "Main-Game/market").moveElement(1075, 330);

            mainBuildings.Find(x => x.AssetName == "Main-Game/profile").moveElement(1700, 900);
            mainBuildings.Find(x => x.AssetName == "Main-Game/wastePlant").moveElement(1100, 580);

            mainBuildings.Find(x => x.AssetName == "Main-Game/boat").moveElement(200, 750);
            mainBuildings.Find(x => x.AssetName == "Main-Game/grounds").moveElement(1185, 240);

            mainBuildings.Find(x => x.AssetName == "Main-Game/farm").moveElement(1250, 390);
            mainBuildings.Find(x => x.AssetName == "Main-Game/Foodtruck").moveElement(840, 480);

            foreach (GUIElement element in backMenu)
            {
                element.LoadContent(content, Obj);
                element.clickEvent += OnClick;
            }
            backMenu.Find(x => x.AssetName == "Back-Menu/main-menu").moveElement(680, 380);
            backMenu.Find(x => x.AssetName == "Back-Menu/settings-button").moveElement(680, 580);
            backMenu.Find(x => x.AssetName == "Back-Menu/close-button").moveElement(1743, 280);
        }
Beispiel #20
0
 public void Update(GameObjects Obj)
 {
     foreach (GUIElement element in main)
     {
         if (element.AssetName == "Main-Menu/cloud")
         {
             Y++;
             if (Y == 1)
             {
                 element.moveElement(X, 0);
                 Y = 0;
             }
             if (element.guiRect.X > 1920)
             {
                 element.moveElement(-3840, 0);
             }
         }
         else
         {
             element.Update(Obj);
         }
     }
 }
        public void Update(GameObjects gameObjects)
        {
            switch (acties)
            {
            case Acties.main:
                foreach (GUIElement element in faction)
                {
                    element.Update(gameObjects);
                }
                break;

            case Acties.Screen1:
                foreach (GUIElement element in Screen1)
                {
                    element.Update(gameObjects);
                }
                break;

            case Acties.Screen2:
                foreach (GUIElement element in Screen2)
                {
                    element.Update(gameObjects);
                }

                break;

            case Acties.Screen3:
                foreach (GUIElement element in Screen3)
                {
                    element.Update(gameObjects);
                }
                break;

            default:
                break;
            }
        }
Beispiel #22
0
        public void Update(GameObjects gameObjects)
        {
            switch (vragen)
            {
            case Acties.vraag:
                quest.Update(gameObjects);
                if (quest.Vraag1)
                {
                    vragen = Acties.main;
                    screen = Screens.Screen1;
                    gameObjects.cluster2 = true;
                }
                break;

            case Acties.main:
                switch (screen)
                {
                case Screens.Screen1:

                    foreach (GUIElement element in MarketScreen1)
                    {
                        element.Update(gameObjects);
                    }
                    break;

                case Screens.Screen2:
                    foreach (GUIElement element in MarketScreen2)
                    {
                        element.Update(gameObjects);
                    }
                    foreach (GUIElement element in Buttons)
                    {
                        element.Update(gameObjects);
                    }
                    break;

                case Screens.Screen3:
                    foreach (GUIElement element in MarketScreen3)
                    {
                        element.Update(gameObjects);
                        if (element.AssetName == "Market/bar")
                        {
                            element.drawParial(gameObjects.TotalRecource, storage);
                            totalrecourc = gameObjects.TotalRecource;
                        }
                        if (element.AssetName == "Market/bar-next")
                        {
                            element.drawParial(Marketlvl + 1, 16);
                        }
                    }
                    if (acties == Acties.upgrade)
                    {
                        Upgradelvl(gameObjects);
                    }
                    if (acties == Acties.error)
                    {
                        error.Update(gameObjects);
                    }
                    break;

                default:
                    break;
                }
                if (screen == Screens.Screen1 || screen == Screens.Screen2 || screen == Screens.Screen3)
                {
                    if (gameObjects.touchInput.swippedLeft)
                    {
                        if (screen == Screens.Screen1)
                        {
                            screen = Screens.Screen2;
                        }
                        else if (screen == Screens.Screen2)
                        {
                            screen = Screens.Screen3;
                        }
                    }
                    if (gameObjects.touchInput.swippedRight)
                    {
                        if (screen == Screens.Screen3)
                        {
                            screen = Screens.Screen2;
                        }
                        else if (screen == Screens.Screen2)
                        {
                            screen = Screens.Screen1;
                        }
                    }
                }
                break;

            default:
                break;
            }
        }
Beispiel #23
0
 public void LoadContent(ContentManager content, GameObjects Obj)
 {
     GUITexture = content.Load <Texture2D> (assetName);
     GUIRect    = new Rectangle(0, 0, (GUITexture.Width), (GUITexture.Height));
 }
Beispiel #24
0
        public void Draw(SpriteBatch spriteBatch, GameObjects obj)
        {
            switch (gamePart)
            {
            case GamePart.main:
                foreach (GUIElement element in mainBuildings)
                {
                    if (obj.Gekozen == false && obj.cluster4)
                    {
                        choose.Draw(spriteBatch);
                    }
                    else if (element.AssetName == "Main-Game/Flag" || element.AssetName == "Main-Game/farm" ||
                             element.AssetName == "Main-Game/Foodtruck" || element.AssetName == "Main-Game/market" || element.AssetName == "Main-Game/wastePlant" || element.AssetName == "Main-Game/barracks")
                    {
                        if ((element.AssetName == "Main-Game/market" || element.AssetName == "Main-Game/farm") && obj.cluster1)
                        {
                            element.Draw(spriteBatch);
                        }
                        if (element.AssetName == "Main-Game/Foodtruck" && obj.cluster2)
                        {
                            element.Draw(spriteBatch);
                        }
                        if (element.AssetName == "Main-Game/wastePlant" && obj.cluster3)
                        {
                            element.Draw(spriteBatch);
                        }


                        if ((element.AssetName == "Main-Game/farm" || element.AssetName == "Main-Game/Flag" || element.AssetName == "Main-Game/barracks") && obj.Gekozen)
                        {
                            element.Draw(spriteBatch);
                        }
                    }
                    else
                    {
                        element.Draw(spriteBatch);
                    }
                }
                if (obj.Gekozen)
                {
                    spriteBatch.DrawString(font, obj.XP.ToString() + "/" + obj.NextLevel.ToString(), new Vector2(480, 65), Color.Black, 0, new Vector2(0, 0), 2.5f, SpriteEffects.None, 0f);
                    spriteBatch.DrawString(font, obj.Money.ToString(), new Vector2(150, 55), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);
                    spriteBatch.DrawString(font, obj.PLayerLevel.ToString(), new Vector2(390, 55), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);
                }
                break;

            case GamePart.BackMenu:
                foreach (GUIElement element in mainBuildings)
                {
                    element.Draw(spriteBatch);
                }
                spriteBatch.DrawString(font, obj.XP.ToString() + "/" + obj.NextLevel.ToString(), new Vector2(480, 65), Color.Black, 0, new Vector2(0, 0), 2.5f, SpriteEffects.None, 0f);
                spriteBatch.DrawString(font, obj.Money.ToString(), new Vector2(150, 55), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);
                spriteBatch.DrawString(font, obj.PLayerLevel.ToString(), new Vector2(390, 55), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);

                foreach (GUIElement element in backMenu)
                {
                    element.Draw(spriteBatch);
                }
                spriteBatch.DrawString(font, obj.XP.ToString() + "/" + obj.NextLevel.ToString(), new Vector2(480, 65), Color.Black, 0, new Vector2(0, 0), 2.5f, SpriteEffects.None, 0f);
                spriteBatch.DrawString(font, obj.Money.ToString(), new Vector2(150, 55), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);
                spriteBatch.DrawString(font, obj.PLayerLevel.ToString(), new Vector2(390, 55), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);

                break;

            default:
                break;
            }
        }
Beispiel #25
0
        public void Update(GameObjects gameObjects)
        {
            switch (vragen)
            {
            case Acties.vraag:
                quest.Update(gameObjects);
                if (quest.Vraag1)
                {
                    vragen = Acties.main;
                    gameObjects.cluster4 = true;
                }
                break;

            case Acties.main:
                maxBio  = (80 * gameObjects.amountTiles);
                maxChem = (70 * gameObjects.amountTiles);
                foreach (GUIElement element in waste)
                {
                    element.Update(gameObjects);
                    if (element.AssetName == "WastePlant/bar-bio")
                    {
                        element.drawParial(gameObjects.waste, maxBio);
                    }
                    if (element.AssetName == "WastePlant/bar-chem")
                    {
                        element.drawParial(gameObjects.Chemwaste, (70 * gameObjects.amountTiles));
                    }
                    if (element.AssetName == "WastePlant/bar-cap")
                    {
                        element.drawParial(gameObjects.Chemwaste + gameObjects.waste, (maxBio + maxChem));
                    }
                    if (element.AssetName == "WastePlant/bar-nextcap")
                    {
                        element.drawParial(gameObjects.Chemwaste + gameObjects.waste, (maxBio + 160 + maxChem + 160));
                    }
                    if (element.AssetName == "WastePlant/bar-ratio")
                    {
                        element.drawParial(gameObjects.Chemwaste, gameObjects.waste);
                    }
                    if (element.AssetName == "WastePlant/bar-nextratio")
                    {
                        element.drawParial(gameObjects.Chemwaste, gameObjects.waste);
                    }

                    if (element.AssetName == "WastePlant/bar-speed")
                    {
                        element.drawParial(wastelevel + 1, 16);
                    }
                    if (element.AssetName == "WastePlant/bar-nextspeed")
                    {
                        element.drawParial(wastelevel + 2, 16);
                    }
                }
                if (acties == Acties.Upgrade)
                {
                    acties = Acties.main;
                    Upgradelvl(gameObjects);
                }
                if (acties == Acties.error)
                {
                    error.Update(gameObjects);
                }
                Chemwaste = gameObjects.Chemwaste;
                Biowaste  = gameObjects.waste;
                break;

            default:
                break;
            }
        }
Beispiel #26
0
 public BaseLogics(GameTime gameTime, GameObjects obj)
 {
 }
Beispiel #27
0
        public void Draw(SpriteBatch spriteBatch, GameObjects obj)
        {
            int x = 0;

            switch (vragen)
            {
            case Acties.vraag:
                quest.Draw(spriteBatch);
                break;

            case Acties.main:
                switch (screen)
                {
                case Screens.Screen1:
                    foreach (GUIElement element in MarketScreen1)
                    {
                        if (element.AssetName == "storage/grains_bar" || element.AssetName == "storage/Bar-vegie" || element.AssetName == "storage/Bar-fish" || element.AssetName == "storage/Bar-meat" ||
                            element.AssetName == "storage/grain-sym" || element.AssetName == "storage/vege-sym" || element.AssetName == "storage/fish-sym" || element.AssetName == "storage/meat-sym")
                        {
                            if (element.AssetName == "storage/grains_bar")
                            {
                                Rectangle rect = element.returnRect(obj.Grains, storage);
                                rect.X = 140;
                                rect.Y = 883;
                                element.Draw(spriteBatch, rect);
                                x = 140 + rect.Width;
                            }
                            if (element.AssetName == "storage/grain-sym")                               //symbol
                            {
                                Rectangle rect = element.guiRect;
                                rect.X = x;
                                rect.Y = 760;
                                element.Draw(spriteBatch, rect);
                                spriteBatch.DrawString(font, obj.Grains.ToString(), new Vector2(rect.X - 20, 770), Color.Black, 0, new Vector2(0, 0), 2f, SpriteEffects.None, 0f);
                            }
                            if (element.AssetName == "storage/Bar-vegie")
                            {
                                Rectangle rect = element.returnRect(obj.Vegies, storage);
                                rect.X = x;
                                rect.Y = 883;
                                element.Draw(spriteBatch, rect);
                                x += rect.Width;
                            }
                            if (element.AssetName == "storage/vege-sym")                              //symbol
                            {
                                Rectangle rect = element.guiRect;
                                rect.X = x;
                                rect.Y = 760;
                                element.Draw(spriteBatch, rect);
                                spriteBatch.DrawString(font, obj.Vegies.ToString(), new Vector2(rect.X - 20, 770), Color.Black, 0, new Vector2(0, 0), 2f, SpriteEffects.None, 0f);
                            }
                            if (element.AssetName == "storage/Bar-fish")
                            {
                                Rectangle rect = element.returnRect(obj.Fish, storage);
                                rect.X = x;
                                rect.Y = 883;
                                element.Draw(spriteBatch, rect);
                                x += rect.Width;
                            }
                            if (element.AssetName == "storage/fish-sym")                              //symbol
                            {
                                Rectangle rect = element.guiRect;
                                rect.X = x;
                                rect.Y = 760;
                                element.Draw(spriteBatch, rect);
                                spriteBatch.DrawString(font, obj.Fish.ToString(), new Vector2(rect.X - 20, 770), Color.Black, 0, new Vector2(0, 0), 2f, SpriteEffects.None, 0f);
                            }
                            if (element.AssetName == "storage/Bar-meat")
                            {
                                Rectangle rect = element.returnRect(obj.Meat, storage);
                                rect.X = x;
                                rect.Y = 883;
                                element.Draw(spriteBatch, rect);
                                x += rect.Width;
                            }
                            if (element.AssetName == "storage/meat-sym")                              //symbol
                            {
                                Rectangle rect = element.guiRect;
                                rect.X = x;
                                rect.Y = 760;
                                element.Draw(spriteBatch, rect);
                                spriteBatch.DrawString(font, obj.Meat.ToString(), new Vector2(rect.X - 20, 770), Color.Black, 0, new Vector2(0, 0), 2f, SpriteEffects.None, 0f);
                                spriteBatch.DrawString(font, Marketlvl.ToString(), new Vector2(1000, 80), Color.White, 0, new Vector2(0, 0), 2f, SpriteEffects.None, 0f);
                            }
                        }
                        else
                        {
                            element.Draw(spriteBatch);
                        }
                    }
                    break;

                case Screens.Screen2:
                    foreach (GUIElement element in MarketScreen2)
                    {
                        element.Draw(spriteBatch);
                    }
                    foreach (GUIElement element in Buttons)
                    {
                        element.Draw(spriteBatch);
                    }
                    spriteBatch.DrawString(font, Marketlvl.ToString(), new Vector2(1000, 80), Color.White, 0, new Vector2(0, 0), 2f, SpriteEffects.None, 0f);

                    spriteBatch.DrawString(font, aGrain.ToString(), new Vector2(385, 818), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);
                    spriteBatch.DrawString(font, aFish.ToString(), new Vector2(755, 818), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);
                    spriteBatch.DrawString(font, aVege.ToString(), new Vector2(1125, 818), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);
                    spriteBatch.DrawString(font, aMeat.ToString(), new Vector2(1495, 818), Color.Black, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);


                    break;

                case Screens.Screen3:
                    foreach (GUIElement element in MarketScreen3)
                    {
                        element.Draw(spriteBatch);
                    }
                    if (acties == Acties.error)
                    {
                        error.Draw(spriteBatch, Drawerror.Acties.market);
                    }

                    spriteBatch.DrawString(font, Marketlvl.ToString(), new Vector2(1000, 80), Color.White, 0, new Vector2(0, 0), 2f, SpriteEffects.None, 0f);

                    spriteBatch.DrawString(font, "Current " + totalrecourc.ToString() + "/" + storage.ToString(), new Vector2(174, 898), Color.Black, 0, new Vector2(0, 0), 1.7f, SpriteEffects.None, 0f);
                    spriteBatch.DrawString(font, "next Level: " + (Marketlvl + 2).ToString(), new Vector2(1237, 898), Color.Black, 0, new Vector2(0, 0), 1.7f, SpriteEffects.None, 0f);
                    spriteBatch.DrawString(font, ((Marketlvl + 1) * 80).ToString(), new Vector2(1080, 950), Color.White, 0, new Vector2(0, 0), 3f, SpriteEffects.None, 0f);

                    break;

                default:
                    break;
                }

                break;

            default:
                break;
            }
        }
Beispiel #28
0
        public void LoadContent(ContentManager content, GameObjects gameObjects)
        {
            font = content.Load <SpriteFont> ("MyFont");
            quest.LoadContent(content, gameObjects);
            if (quest.Vraag1 == false)
            {
                vragen = Acties.vraag;
                gameObjects.cluster1 = false;
            }
            foreach (GUIElement element in MarketScreen1)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }
            MarketScreen1.Find(x => x.AssetName == "Cross-Screen/Island-bg").PutBg();
            MarketScreen1.Find(x => x.AssetName == "Market/storage-bg").moveElement(65, 25);
            MarketScreen1.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1750, 65);



            foreach (GUIElement element in MarketScreen2)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }
            MarketScreen2.Find(x => x.AssetName == "Cross-Screen/Island-bg").PutBg();
            MarketScreen2.Find(x => x.AssetName == "Market/Buy/buy-sell-bg").moveElement(65, 25);
            MarketScreen2.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1750, 65);
            MarketScreen2.Find(x => x.AssetName == "Market/Buy/buy-button").moveElement(1575, 780);
            MarketScreen2.Find(x => x.AssetName == "Market/Buy/sell-button").moveElement(1575, 885);


            foreach (GUIElement element in Buttons)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }
            Buttons.Find(x => x.AssetName == "Market/Buy/plus-grain").moveElement(370, 750);

            Buttons.Find(x => x.AssetName == "Market/Buy/plus-fish").moveElement(740, 750);

            Buttons.Find(x => x.AssetName == "Market/Buy/plus-veg").moveElement(1110, 750);

            Buttons.Find(x => x.AssetName == "Market/Buy/plus-meat").moveElement(1480, 750);

            Buttons.Find(x => x.AssetName == "Market/Buy/minus-grain").moveElement(370, 900);
            Buttons.Find(x => x.AssetName == "Market/Buy/minus-fish").moveElement(740, 900);
            Buttons.Find(x => x.AssetName == "Market/Buy/minus-veg").moveElement(1110, 900);
            Buttons.Find(x => x.AssetName == "Market/Buy/minus-meat").moveElement(1480, 900);

            Buttons.ElementAt(8).moveElement(370, 815);
            Buttons.ElementAt(9).moveElement(740, 815);
            Buttons.ElementAt(10).moveElement(1110, 815);
            Buttons.ElementAt(11).moveElement(1480, 815);


            foreach (GUIElement element in MarketScreen3)
            {
                element.LoadContent(content, gameObjects);
                element.clickEvent += OnClick;
            }
            MarketScreen3.Find(x => x.AssetName == "Cross-Screen/Island-bg").PutBg();
            MarketScreen3.Find(x => x.AssetName == "Market/upgrade-screen").moveElement(65, 25);
            MarketScreen3.Find(x => x.AssetName == "Cross-Screen/X").moveElement(1750, 65);
            MarketScreen3.Find(x => x.AssetName == "Cross-Screen/upgrade").moveElement(830, 735);


            MarketScreen3.Find(x => x.AssetName == "Market/bar").moveElement(169, 895);
            MarketScreen3.Find(x => x.AssetName == "Market/bar-next").moveElement(1233, 895);

            error.LoadContent(content, gameObjects);
        }