Ejemplo n.º 1
0
        public static SimpleAnimation CreateAnimation(Direction Direction)
        {
            var bonus = 20;
            var tx    = -World.SPACE_BETWEEN_THINGS * bonus;
            var ty    = -World.SPACE_BETWEEN_THINGS * bonus;
            var tz    = 0.9f;
            var tw    = SIZE + World.SPACE_BETWEEN_THINGS * bonus;
            var th    = SIZE + World.SPACE_BETWEEN_THINGS * bonus;

            SimpleAnimation Animation;

            if (Direction == Direction.Center)
            {
                Animation = GeneratedContent.Create_background_wall_center(tx, ty, tz, tw, th);
            }
            else if (Direction == Direction.Left)
            {
                Animation = GeneratedContent.Create_background_wall_left(tx, ty, tz, tw, th);
            }
            else if (Direction == Direction.Right)
            {
                Animation = GeneratedContent.Create_background_wall_right(tx, ty, tz, tw, th);
            }
            else if (Direction == Direction.Top)
            {
                Animation = GeneratedContent.Create_background_wall_top(tx, ty, tz, tw, th);
            }
            else
            {
                Animation = GeneratedContent.Create_background_wall_bot(tx, ty, tz, tw, th);
            }

            Animation.ChangeColor(new Color(158, 165, 178));

            return(Animation);
        }
Ejemplo n.º 2
0
        private void CreateBlocks(int rowNumber, int colNumber)
        {
            //remove left wall? let the player fall?
            var cellsize = 1000 + World.SPACE_BETWEEN_THINGS;

            for (int i = 1; i < rowNumber; i++)
            {
                World.Add(new Block(Direction.Top)
                {
                    X = i * cellsize,
                    Y = cellsize
                });
            }

            for (int i = 1; i <= colNumber; i++)
            {
                World.Add(new Block(i == 1 || i == colNumber ? Direction.Center : Direction.Left)
                {
                    X = 0,
                    Y = i * cellsize
                });
            }

            for (int i = 1; i < rowNumber; i++)
            {
                World.Add(new Block(Direction.Bot)
                {
                    X = i * cellsize,
                    Y = cellsize * colNumber
                });
            }

            for (int i = 1; i <= colNumber; i++)
            {
                if (i == 2)
                {
                    World.Add(new InvisibleBlock()
                    {
                        X = cellsize * rowNumber,
                        Y = i * cellsize
                    });
                    continue;
                }

                World.Add(new Block(i == 1 || i == colNumber ? Direction.Center : Direction.Right)
                {
                    X = cellsize * rowNumber,
                    Y = i * cellsize
                });
            }

            var backgrond = GeneratedContent.Create_background_wall_center(
                0
                , cellsize * 6
                , 1
                , cellsize * 14
                , cellsize * 4);

            backgrond.ChangeColor(new Color(158, 165, 178));
            World.Add(backgrond);
        }