Exemplo n.º 1
0
        public void midLevelGeneratorAdd()
        {
            x1 = 1100;
            //End Barrier, let's make it a 25% chance that a barrier occurs here
            if (rnd.Next(0, 100) < 10)
            {
                block b = new block(this);
                b.LoadContent();
                b.setTexture("longBrick3");

                b.position = new Vector2(x1, 600 - (b.Height / 4));
                x1        += (int)b.Width;
                allBlocksAdd.Add(b);
            }

            for (int i = 0; i < rnd.Next(2, 4); i++)
            {
                block b = new block(this);
                b.LoadContent();
                midBlocksAdd.Add(b);
                allBlocksAdd.Add(b);
            }

            //for loop trial for "randomly" placing tiles


            foreach (block b in midBlocksAdd)
            {
                b.position = new Vector2(x1, 600 - (b.Height / 4));
                x1        += (int)b.Width;
            }

            //make last block a barrier too, make this 50/50?
            if (rnd.Next(0, 100) < 50)
            {
                block b = new block(this);
                b.setTexture("longBrick3");

                b.LoadContent();
                b.position = new Vector2(x1, 600 - (b.Height / 4));
                x1        += (int)b.Width;
                allBlocksAdd.Add(b);
            }
        }
Exemplo n.º 2
0
        public void topLevelGeneratorAdd()
        {
            for (int i = 0; i < rnd.Next(2, 8); i++)
            {
                block b = new block(this);
                b.LoadContent();
                topBlocksAdd.Add(b);
                allBlocksAdd.Add(b);
            }

            //for loop trial for "randomly" placing tiles


            x1 = 1400;
            foreach (block b in topBlocksAdd)
            {
                b.position = new Vector2(x1, 350);
                x1        += (int)b.Width;
            }
        }
Exemplo n.º 3
0
        public void topLevelGenerator()
        {
            for (int i = 0; i < rnd.Next(2, 8); i++)
            {
                block b = new block(this);
                b.LoadContent();
                topBlocks.Add(b);
                allBlocks.Add(b);
            }

            //for loop trial for "randomly" placing tiles
            Zombie z = new Zombie(this);

            z.LoadContent();
            z.position.Y = 350 - z.Height;
            z.position.X = 1500;

            x1 = 1400;
            foreach (block b in topBlocks)
            {
                b.position = new Vector2(x1, 350);
                x1        += (int)b.Width;
            }
        }
Exemplo n.º 4
0
        public void lowLevelGeneratorAdd()
        {
            x1 = 1900;
            //End Barrier, let's make it a 25% chance that a barrier occurs here
            if (rnd.Next(0, 100) < 10)
            {
                block b = new block(this);
                b.setTexture("longBrick3");
                b.LoadContent();
                x1        += (int)b.Width;
                b.position = new Vector2(1900, 700 - (b.Height / 4));


                allBlocksAdd.Add(b);
            }

            for (int i = 0; i < rnd.Next(2, 4); i++)
            {
                block b = new block(this);
                b.LoadContent();
                lowBlocksAdd.Add(b);
                allBlocksAdd.Add(b);
            }

            //for loop trial for "randomly" placing tilesfoff


            foreach (block b in lowBlocksAdd)
            {
                b.position = new Vector2(x1, 700);
                x1        += (int)b.Width;
            }

            //make last block a barrier too, make this 50/50?
            if (rnd.Next(0, 100) < 50)
            {
                block b = new block(this);
                b.setTexture("longBrick3");
                b.LoadContent();
                b.position = new Vector2(x1, 700 - (b.Height / 4));
                x1        += (int)b.Width;
                allBlocksAdd.Add(b);
                lowBlocksAdd.Add(b);
            }

            //ZOMBIE GENERATION

            /*for (int i = 0; i < rnd.Next(3, 6); i++)
             * {
             *  Zombie Z = new Zombie(this);
             *  Z.LoadContent();
             *  zombies.Add(Z);
             * }
             *
             * int flip = 0;
             * foreach (Zombie z in zombies)
             * {
             *  flip = rnd.Next(0, 1);
             *  int x2 = rnd.Next(1900, x1);
             *  /*if (flip == 0)
             *  {
             *      z.position = new Vector2(x1, 700);
             *  }
             *  else
             *      z.position = new Vector2(x1, 400);
             *
             *  z.position = new Vector2(x2, 400);
             * } */
        }