Beispiel #1
0
        public static void MakeLevers(Game1 game, List <Objects> Blockers)
        {
            for (int i = 0; i < Blockers.Count; i++)
            {
                if (Blockers[i] is Spak)
                {
                    ((Spak)Blockers[i]).Changers.Clear();
                    Blockers.Remove(Blockers[i]);
                    i--;
                }
                else if (Blockers[i] is BrownBlock)
                {
                    if (((BrownBlock)Blockers[i]).ChangeAble != 0)
                    {
                        Blockers.Remove(Blockers[i]);
                        i--;
                    }
                }
            }
            int InsertHere = 0;

            for (int i = 0; i < Blockers.Count; i++)
            {
                if (!(Blockers[i] is BrownBlock))
                {
                    InsertHere = i;
                    break;
                }
            }

            switch (game.CurrentLvl)
            {
            case 2:
                List <Objects> Changers = new List <Objects>();
                Changers.Add(new BrownBlock(game.Content.Load <Texture2D>("Gräs"), new Rectangle(200, 0, 50, 50), game, false, 1, true));
                Changers.Add(new BrownBlock(game.Content.Load <Texture2D>("Gräs"), new Rectangle(250, 0, 50, 50), game, false, 1, true));
                Changers.Add(new BrownBlock(game.Content.Load <Texture2D>("Gräs"), new Rectangle(250, 200, 50, 50), game, false, 1, true));
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(300, 200, 50, 50), game, Changers));
                Blockers.InsertRange(InsertHere, Changers);

                List <Objects> Changers2 = new List <Objects>();
                Changers2.Add(new BrownBlock(game.Content.Load <Texture2D>("Gräs"), new Rectangle(200, 200, 50, 50), game, false, 1, true));
                Changers2.Add(new BrownBlock(game.Content.Load <Texture2D>("Gräs"), new Rectangle(300, 0, 50, 50), game, false, 1, true));
                Changers2.Add(new BrownBlock(game.Content.Load <Texture2D>("Gräs"), new Rectangle(0, 300, 50, 50), game, false, 1, true));
                Changers2.Add(new BrownBlock(game.Content.Load <Texture2D>("Gräs"), new Rectangle(50, 300, 50, 50), game, false, 1, true));
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(150, 200, 50, 50), game, Changers2));
                Blockers.InsertRange(InsertHere, Changers2);
                break;

            case 3:
                List <Objects> Spak1 = new List <Objects>();
                Spak1.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(300, 300, 50, 50), game, false, 1, true));
                Spak1.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(300, 400, 50, 50), game, false, 1, true));
                Spak1.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(350, 300, 50, 50), game, false, 1, true));
                Spak1.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(350, 400, 50, 50), game, false, 1, true));
                Spak1.Add(new BrownBlock(game.Content.Load <Texture2D>("FloorPic"), new Rectangle(0, 350, 50, 50), game, false, 2, true));
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(200, 150, 50, 50), game, Spak1));
                Blockers.InsertRange(InsertHere, Spak1);

                List <Objects> Spak2 = new List <Objects>();
                Spak2.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(0, 300, 50, 50), game, false, 1, true));
                Spak2.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(0, 250, 50, 50), game, false, 1, true));
                Spak2.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(300, 100, 50, 50), game, false, 1, true));
                Spak2.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(300, 150, 50, 50), game, false, 1, true));
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(400, 400, 50, 50), game, Spak2));
                Blockers.InsertRange(InsertHere, Spak2);
                break;

            case 4:

                List <Objects> Spak11 = new List <Objects>();
                Spak11.Add(new BrownBlock(game.Content.Load <Texture2D>("FloorPic"), new Rectangle(350, 50, 50, 50), game, true, 2, true));
                Spak11.Add(new BrownBlock(game.Content.Load <Texture2D>("FloorPic"), new Rectangle(350, 100, 50, 50), game, true, 2, true));
                Spak11.Add(new BrownBlock(game.Content.Load <Texture2D>("FloorPic"), new Rectangle(350, 150, 50, 50), game, true, 2, true));;
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(0, 150, 50, 50), game, Spak11));
                Blockers.InsertRange(InsertHere, Spak11);

                List <Objects> Spak22 = new List <Objects>();
                Spak22.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(300, 100, 50, 50), game, false, 1, true));
                Spak22.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(300, 150, 50, 50), game, false, 1, true));
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(550, 600, 50, 50), game, Spak22));
                Blockers.InsertRange(InsertHere, Spak22);

                List <Objects> Spak3 = new List <Objects>();
                Spak3.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(500, 550, 50, 50), game, false, 1, true));
                Spak3.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(500, 600, 50, 50), game, false, 1, true));;
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(500, 100, 50, 50), game, Spak3));
                Blockers.InsertRange(InsertHere, Spak3);
                break;

            case 5:

                List <Objects> Spak111 = new List <Objects>();
                Spak111.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(550, 400, 50, 50), game, false, 1, true));
                Spak111.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(550, 450, 50, 50), game, false, 1, true));
                Spak111.Add(new BrownBlock(game.Content.Load <Texture2D>("FloorPic"), new Rectangle(150, 400, 50, 50), game, false, 2, true));
                Spak111.Add(new BrownBlock(game.Content.Load <Texture2D>("FloorPic"), new Rectangle(200, 400, 50, 50), game, false, 2, true));
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(250, 500, 50, 50), game, Spak111));
                Blockers.InsertRange(InsertHere, Spak111);

                List <Objects> Spak222 = new List <Objects>();
                Spak222.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(300, 150, 50, 50), game, false, 1, true));
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(50, 400, 50, 50), game, Spak222));
                Blockers.InsertRange(InsertHere, Spak222);

                List <Objects> Spak33 = new List <Objects>();
                Spak33.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(250, 550, 50, 50), game, false, 1, true));
                Spak33.Add(new BrownBlock(game.Content.Load <Texture2D>("gräs"), new Rectangle(250, 600, 50, 50), game, false, 1, true));
                Blockers.Insert(InsertHere, new Spak(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), game.Content.Load <Texture2D>("gräs"), game.Content.Load <Texture2D>("FloorPic"), new Rectangle(250, 150, 50, 50), game, Spak33));
                Blockers.InsertRange(InsertHere, Spak33);

                break;

            default:
                break;
            }
        }
Beispiel #2
0
        public static void Lvl4(Game1 game, List <Objects> Blockers)
        {
            int[,] field = { { 1, 1, 0, 0, 2, 0, 1, 1, 1, 1, 0, 1, 0 },
                             { 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0 },
                             { 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 },
                             { 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 2 },
                             { 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 2 },
                             { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2 },
                             { 0, 1, 1, 1, 2, 0, 1, 1, 0, 0, 0, 0, 0 },
                             { 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0 },
                             { 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1 },
                             { 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1 },
                             { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
                             { 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0 },
                             { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 } };

            MakeGround(game, Blockers, field);
            MakeLevers(game, Blockers);



            List <int> ArrowSpak1Dir = new List <int>();

            ArrowSpak1Dir.Add(4);
            List <Objects> ArrowSpak1     = new List <Objects>();
            List <int>     ArrowSpak1Dir1 = new List <int>();

            ArrowSpak1Dir1.Add(2);
            ArrowSpak1.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(400, 100, 50, 50), game, 2, false, false));
            Blockers.Add(new Spak2(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), new Rectangle(50, 600, 50, 50), game, ArrowSpak1, ArrowSpak1Dir, ArrowSpak1Dir1));
            Blockers.AddRange(ArrowSpak1);

            List <int> ArrowSpak1Dir2 = new List <int>();

            ArrowSpak1Dir2.Add(4);
            List <Objects> ArrowSpak2           = new List <Objects>();
            List <int>     ArrowSpakCurrentDir2 = new List <int>();

            ArrowSpakCurrentDir2.Add(1);
            ArrowSpak2.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(200, 600, 50, 50), game, 1, false, false));
            Blockers.Add(new Spak2(game.Content.Load <Texture2D>("Spak1"), game.Content.Load <Texture2D>("Spak2"), new Rectangle(300, 550, 50, 50), game, ArrowSpak2, ArrowSpak1Dir2, ArrowSpakCurrentDir2));
            Blockers.AddRange(ArrowSpak2);

            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(600, 300, 50, 50), game, 4, false, false));
            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(500, 300, 50, 50), game, 1, false, false));
            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(0, 600, 50, 50), game, 1, false, false));
            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(400, 550, 50, 50), game, 3, false, false));

            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(500, 250, 50, 50), game, 4, false, false));
            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(400, 300, 50, 50), game, 1, false, false));
            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(200, 250, 50, 50), game, 3, false, false));
            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("nonepil"), new Rectangle(250, 250, 50, 50), game, 3, false, false));

            Blockers.Add(new Studds(game.Content.Load <Texture2D>("studsis"), new Rectangle(300, 650, 50, 50), game, true, true));
            Blockers.Add(new Studds(game.Content.Load <Texture2D>("studsis"), new Rectangle(350, 650, 50, 50), game, true, true));
            Blockers.Add(new Studds(game.Content.Load <Texture2D>("studsis"), new Rectangle(400, 650, 50, 50), game, true, true));
            Blockers.Add(new Studds(game.Content.Load <Texture2D>("studsis"), new Rectangle(450, 650, 50, 50), game, true, true));

            Blockers.Add(new Arrow(game.Content.Load <Texture2D>("multiarrow"), new Rectangle(250, 650, 50, 50), game, 1, true, true));

            for (int i = 0; i < 4; i++)
            {
                Blockers.Add(new Arrow(game.Content.Load <Texture2D>("pil"), new Rectangle(50 * i, 650, 50, 50), game, 1, false, true));
            }

            Blockers.Add(new Goal(game.Content.Load <Texture2D>("dabuss"), new Rectangle(100, 0, 100, 50), game));
            MakePlayers(game, Blockers);
        }