예제 #1
0
        public bool WallCheck()
        {
            bool    updated = false;
            Vector3 me      = Core.Me.Location;

            wallList.Clear();
            if (_walls == null)
            {
                return(false);
            }

            foreach (KeyValuePair <uint, List <Vector3> > id in _walls.Where(i =>
                                                                             i.Value[0].Distance2D(Core.Me.Location) < 5 && !Walls.ContainsKey(i.Key) &&
                                                                             !_activeWalls.Contains(i.Key)))
            {
                Vector3 wall1 = id.Value[1];
                wall1.Y -= 5;

                Vector3 wall2 = id.Value[2];
                wall2.Y -= 10;

                wallList.Add(new BoundingBox3 {
                    Min = wall1, Max = wall2
                });
                Walls.Add(id.Key, true);
                updated = true;
            }

            //Logger.Debug($"[walls] {string.Join(", ", _hit.Keys)}");

            return(updated);
        }
예제 #2
0
파일: BattleField.cs 프로젝트: IDgtl/Pacman
        private void CreateInterior()
        {
            Walls.Add(new Wall(30, 0, 390, 30));
            Walls.Add(new Wall(90, 60, 60, 30));
            Walls.Add(new Wall(180, 60, 90, 30));
            Walls.Add(new Wall(300, 60, 60, 30));
            Walls.Add(new Wall(120, 120, 90, 30));
            Walls.Add(new Wall(240, 120, 90, 30));
            Walls.Add(new Wall(30, 180, 60, 30));
            Walls.Add(new Wall(150, 180, 60, 30));
            Walls.Add(new Wall(240, 180, 60, 30));
            Walls.Add(new Wall(360, 180, 60, 30));
            Walls.Add(new Wall(30, 240, 60, 30));
            Walls.Add(new Wall(150, 240, 150, 30));
            Walls.Add(new Wall(360, 240, 60, 30));
            Walls.Add(new Wall(120, 300, 90, 30));
            Walls.Add(new Wall(240, 300, 90, 30));
            Walls.Add(new Wall(90, 360, 60, 30));
            Walls.Add(new Wall(180, 360, 90, 30));
            Walls.Add(new Wall(300, 360, 60, 30));
            Walls.Add(new Wall(30, 420, 390, 30));

            Walls.Add(new Wall(0, 0, 30, 210));
            Walls.Add(new Wall(0, 240, 30, 210));
            Walls.Add(new Wall(60, 60, 30, 90));
            Walls.Add(new Wall(60, 300, 30, 90));
            Walls.Add(new Wall(120, 180, 30, 90));
            Walls.Add(new Wall(300, 180, 30, 90));
            Walls.Add(new Wall(360, 60, 30, 90));
            Walls.Add(new Wall(360, 300, 30, 90));
            Walls.Add(new Wall(420, 0, 30, 210));
            Walls.Add(new Wall(420, 240, 30, 210));
        }
예제 #3
0
        private void SetWalls(double PlayerAndWallSkin)//generate Walls
        {
            //set three rows of walls
            for (int row = 0; row < 3; row++)
            {
                //set six walls per row
                for (int wallPerRow = 0; wallPerRow < 6; wallPerRow++)
                {
                    //set five wallBlocks
                    for (int wallStack = 0; wallStack < 5; wallStack++)
                    {
                        //new object of the type Wall
                        Wall w = new Wall(GameDisplay)
                        {
                            X = wallPerRow * (20 + 1) + (wallStack * 730 / 5) + 15,
                            Y = row * 20 + 550
                        };
                        Walls.Add(w);
                        switch (PlayerAndWallSkin)//instanciates a new Image foreach Wall
                        {
                        case 0: w.Reci.Fill = new ImageBrush(new BitmapImage(new Uri("Images/Walls/WallRed.PNG", UriKind.Relative))); break;

                        case 1: w.Reci.Fill = new ImageBrush(new BitmapImage(new Uri("Images/Walls/WallGreen.PNG", UriKind.Relative))); break;

                        case 2: w.Reci.Fill = new ImageBrush(new BitmapImage(new Uri("Images/Walls/WallBlue.PNG", UriKind.Relative))); break;

                        case 3: w.Reci.Fill = new ImageBrush(new BitmapImage(new Uri("Images/Walls/WallYellow.PNG", UriKind.Relative))); break;
                        }
                    }
                }
            }
        }
예제 #4
0
        private bool WallCheck()
        {
            var updated = false;
            var me      = Core.Me.Location;

            if (_walls == null)
            {
                return(false);
            }

            if (_walls.Count < 1)
            {
                return(false);
            }

            foreach (var id in _walls.Where(i => i.Value[0].Distance2D(Core.Me.Location) < 50 && !Walls.ContainsKey(i.Key) && !activeWalls.Contains(i.Key)))
            {
                var wall1 = id.Value[1];
                wall1.Y -= 2;

                wallList.Add(new BoundingBox3 {
                    Min = wall1, Max = id.Value[2]
                });
                Walls.Add(id.Key, true);
                updated = true;
            }

            //Logger.Info($"[walls] {string.Join(", ", _hit.Keys)}");

            return(updated);
        }
예제 #5
0
        public void BuildWorld(LevelData data)
        {
            CurrentLevelData = data;

            foreach (var levelObject in data.LevelObjects)
            {
                var levelPos = TilesToPixels(levelObject.Key);

                switch (levelObject.Value.Type)
                {
                case TileType.Solid:
                    Walls.Add(new StaticTile(levelPos, levelObject.Value.Key));
                    break;

                case TileType.PowerUp:
                    Powerups.Add(new Powerup(levelPos));
                    break;

                case TileType.Spawner:
                    spawnPointPositions.Add(levelPos);
                    break;

                default:
                    throw new ArgumentOutOfRangeException("Tile type not supported!");
                }
            }

            foreach (var parallaxLayer in data.Parallax)
            {
                bgLayers.Add(new ParallaxLayer(parallaxLayer.Speed, parallaxLayer.SourceFile));
            }

            game.renderer.LevelArea = TilesToPixels(data.TilesArea);
        }
예제 #6
0
        private void CreateWalls()
        {
            // Right wall
            Walls.Add(new Wall(
                          new Vector2D(Width / 2, 0),
                          Depth,
                          2
                          ));

            // Back wall
            Walls.Add(new Wall(
                          new Vector2D(0, Depth / 2),
                          Width,
                          3
                          ));

            // Left wall
            Walls.Add(new Wall(
                          new Vector2D(-Width / 2, 0),
                          Depth,
                          0
                          ));

            // Front wall
            Walls.Add(new Wall(
                          new Vector2D(0, -Depth / 2),
                          Width,
                          1
                          ));
        }
예제 #7
0
        /// <summary>
        /// Adds a light
        /// </summary>
        /// <param name="Wall">Handle</param>
        public void AddWall(Wall wall)
        {
            if (wall == null)
            {
                return;
            }

            Walls.Add(wall);
        }
예제 #8
0
 private void CreateWalls()
 {
     Walls.Add(new Wall(140, 185, 50, 65));
     Walls.Add(new Wall(170, 185, 140, 230));
     Walls.Add(new Wall(30, 45, 80, 125));
     Walls.Add(new Wall(100, 115, 5, 65));
     Walls.Add(new Wall(80, 125, 130, 145));
     Walls.Add(new Wall(0, 60, 170, 185));
 }
예제 #9
0
        private void SetFallingWall()
        {
            int i = Turn - 359;

            if (i >= 0 && i < Utils.FALLING_WALL.Length)
            {
                Position p = new Position(Utils.FALLING_WALL[i][0], Utils.FALLING_WALL[i][1]);
                Walls.Add(p);
            }
        }
예제 #10
0
파일: L3.cs 프로젝트: RobinJSanders/CodeBot
 override protected void CallOnLoad()
 {
     bot.SetPosition(6, 15, "up");
     WallBuild.Vertical(5, 4, 12, Walls, this);
     WallBuild.Vertical(7, 6, 10, Walls, this);
     WallBuild.Horizontal(8, 6, 10, Walls, this);
     WallBuild.Horizontal(6, 4, 12, Walls, this);
     Walls.Add(new Wall(18, 5, this));
     Exits.Add(new Exit(17, 5, this, new L4()));
 }
예제 #11
0
        /// <summary>
        /// Adds a new wall.
        /// </summary>
        /// <param name="body">The body of the wall.</param>
        /// <returns>New wall.</returns>
        public Wall NewWall(Segment body)
        {
            Wall tmp = new Wall()
            {
                Body = body
            };

            Walls.Add(tmp);
            return(tmp);
        }
예제 #12
0
        /// <summary>
        /// Adds a new wall.
        /// </summary>
        /// <returns>New wall.</returns>
        public Wall NewWall()
        {
            Wall tmp = new Wall()
            {
                Body = new Segment()
            };

            Walls.Add(tmp);
            return(tmp);
        }
예제 #13
0
        private void ReadWall(XmlReader reader)
        {
            Wall wall = new Wall();

            wall.ID = random.Next();
            ReadWallEndpoint1(reader, out Vector2D endPoint1);
            ReadWallEndpoint2(reader, out Vector2D endPoint2);
            wall.EndPoint1 = endPoint1;
            wall.EndPoint2 = endPoint2;
            Walls.Add(wall);
        }
예제 #14
0
 public LevelInfo(GameWallHolder holder)
 {
     Name        = holder.LevelName;
     PointSpawns = holder.Locations;
     GameWalls   = new Walls(holder.Walls.Length);
     for (int i = 0; i < holder.Walls.Length; i++)
     {
         GameWalls.Add(new Wall(holder.Walls[i]));
     }
     PlayerSpawn = holder.PlayerSpawn;
 }
예제 #15
0
        public void Initialize(Vector3Int mapSize)
        {
            GameObject space = GameObject.Find("QL_Space"), wall = GameObject.Find("QL_Wall"), goal = GameObject.Find("QL_Goal");

            int k = 0;

            for (int z = mapSize.z - 1; z >= 0; z--)
            {
                for (int y = mapSize.y - 1; y >= 0; y--)
                {
                    for (int x = 0; x < mapSize.x; x++)
                    {
                        space.transform.position = new Vector3(x, mapSize.y - 1 - y, mapSize.z - 1 - z);

                        switch (map[z, y, x])
                        {
                        case 'G':
                            goal.transform.position = new Vector3(x, y, z);
                            Spaces.Add(Object.Instantiate(space));
                            Finish = Object.Instantiate(goal);
                            break;

                        case 'W':
                            wall.transform.position = new Vector3(x, y, z);
                            Spaces.Add(Object.Instantiate(space));
                            Walls.Add(Object.Instantiate(wall));
                            break;

                        case 'S':
                            Spaces.Add(Object.Instantiate(space));
                            Initials.Add(k);
                            break;
                        }

                        k++;
                    }
                }
            }

            for (int i = 0; i < Spaces.Count; i++)
            {
                Spaces[i].name = "Position " + i;
            }

            for (int i = 0; i < Walls.Count; i++)
            {
                Walls[i].name = "Walls " + i;
            }

            Object.Destroy(space);
            Object.Destroy(wall);
            Object.Destroy(goal);
        }
예제 #16
0
        /// <summary>
        /// Adding Walls to the world,  They are never updated. Only added once.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="message"></param>
        public void AddWall(JObject obj, string message)
        {
            // Get the object
            int  id   = (int)obj.First;
            Wall wall = JsonConvert.DeserializeObject <Wall>(message);

            // Add if object does not exist yet.
            if (!Walls.ContainsKey(id))
            {
                Walls.Add(id, wall);
            }
        }
예제 #17
0
        /// <summary>
        /// This method adds the walls to the list of walls
        /// </summary>
        /// <param name="wallLocation"> location to draw the wall </param>
        /// <param name="wt"> The type of wall, Hard or Weak </param>
        /// <param name="ws"> The Shape of the wall </param>
        /// <param name="width"> The width of the wall </param>
        /// <param name="height"> The height of the wall </param>
        private void AddWalls(Point wallLocation, WallType wt, WallShape ws, int width, int height)
        {
            //create a temporary point to hold the location we are adding to
            Point tempPoint = new Point(wallLocation.X, wallLocation.Y);

            switch (ws)
            {
            //add an 'o' shaped wall
            case WallShape.o:
                //copy of the origin point for drawing
                Point drawPoint = tempPoint;
                //nested for loop because the shape is a equilateral
                for (int i = 0; i < height / Tilesize; ++i)
                {
                    //move the draw point down
                    drawPoint.Y = tempPoint.Y + i;
                    //cycle through the horizontal plane
                    for (int j = 0; j < width / Tilesize; ++j)
                    {
                        //move the draw point across the screen
                        drawPoint.X = tempPoint.X + j;
                        //add the wall at the draw point
                        Walls.Add(new Wall(new Point(drawPoint.X * Tilesize, drawPoint.Y * Tilesize), wt));
                    }
                    //reset the drawpoint to the original x position
                    drawPoint.X = tempPoint.X;
                }
                break;

            //add a vertical line shaped wall
            case WallShape.l:
                //single for loop because we are drawing straight down. no change in X
                for (int i = 0; i < height / Tilesize; ++i)
                {
                    Walls.Add(new Wall
                                  (new Point(tempPoint.X * Tilesize, (tempPoint.Y + i) * Tilesize), wt));
                }
                break;

            //add a horizontal line shaped wall
            case WallShape.hl:
                //single for loop because we are drawing straight across. no change in Y
                for (int i = 0; i < width / Tilesize; ++i)
                {
                    Walls.Add(new Wall
                                  (new Point((tempPoint.X + i) * Tilesize, tempPoint.Y * Tilesize), wt));
                }
                break;
            }
        }
예제 #18
0
        public void CreateWalls()
        {
            if (HasWallTop)
            {
                var top = MonoBehaviour.Instantiate(wallPrefab);

                top.transform.position   = WorldPos + Vector3.forward * Size.z * 0.5f;
                top.transform.localScale = new Vector3(Size.x, Size.y, 1f);

                Walls.Add(top);

                top.Rise();
            }

            if (HasWallBottom)
            {
                var bottom = MonoBehaviour.Instantiate(wallPrefab);

                bottom.transform.position   = WorldPos + Vector3.back * Size.z * 0.5f;
                bottom.transform.localScale = new Vector3(Size.x, Size.y, 1f);

                Walls.Add(bottom);

                bottom.Rise();
            }

            if (HasWallRight)
            {
                var right = MonoBehaviour.Instantiate(wallPrefab);

                right.transform.position   = WorldPos + Vector3.right * Size.x * 0.5f;
                right.transform.localScale = new Vector3(1f, Size.y, Size.z);

                Walls.Add(right);

                right.Rise();
            }

            if (HasWallLeft)
            {
                var left = MonoBehaviour.Instantiate(wallPrefab);

                left.transform.position   = WorldPos + Vector3.left * Size.x * 0.5f;
                left.transform.localScale = new Vector3(1f, Size.y, Size.z);

                Walls.Add(left);

                left.Rise();
            }
        }
예제 #19
0
파일: L9.cs 프로젝트: RobinJSanders/CodeBot
        protected override void CallOnLoad()
        {
            bot.SetPosition(7, 15, "up");

            WallBuild.Vertical(6, 7, 10, Walls, this);
            WallBuild.Vertical(8, 8, 9, Walls, this);
            WallBuild.Horizontal(6, 6, 8, Walls, this);
            WallBuild.Horizontal(9, 8, 7, Walls, this);
            WallBuild.Vertical(13, 3, 3, Walls, this);
            WallBuild.Vertical(15, 3, 5, Walls, this);
            Walls.Add(new Wall(14, 3, this));
            Walls.Add(new Wall(7, 16, this));

            Exits.Add(new Exit(14, 4, this, new L10()));
        }
예제 #20
0
        private void LoadWalls(XDocument doc)
        {
            var elemList = doc.Descendants("Wall");
            int x, y, sx, sy;

            foreach (var item in elemList)
            {
                int.TryParse(item.Attribute("X").Value, out x);
                int.TryParse(item.Attribute("Y").Value, out y);
                int.TryParse(item.Attribute("SizeX").Value, out sx);
                int.TryParse(item.Attribute("SizeY").Value, out sy);
                Walls.Add(new Wall {
                    X = x, Y = y, SizeX = sx, SizeY = sy
                });
            }
        }
예제 #21
0
        protected override void CallOnLoad()
        {
            bot.SetPosition(13, 17, "left");

            int x = 7;
            int y = 6;
            int l = 9;

            for (int i = 0; i < 3; i++)
            {
                WallBuild.Horizontal(x, y, l, Walls, this);
                x += 2;
                y += 2;
                l -= 1;
                WallBuild.Horizontal(x, y, l, Walls, this);
                x -= 1;
                y += 2;
                l -= 1;
            }
            x = 17;
            y = 5;
            l = 4;
            for (int i = 0; i < 3; i++)
            {
                WallBuild.Vertical(x, y, l, Walls, this);
                x -= 1;
                y += 4;
            }
            x = 7;
            y = 7;
            for (int i = 0; i < 3; i++)
            {
                WallBuild.Vertical(x, y, l, Walls, this);
                x += 1;
                y += 4;
            }
            WallBuild.Horizontal(15, 4, 3, Walls, this);
            WallBuild.Horizontal(9, 18, 6, Walls, this);
            Walls.Add(new Wall(15, 5, this));
            Walls.Add(new Wall(14, 17, this));

            Exits.Add(new Exit(16, 5, this, new Debreifing()));
        }
예제 #22
0
        public void addWalls()
        {
            int     length        = 10;
            int     width         = 12;
            Vector2 doorOffset    = new Vector2(32, 32);
            Vector2 upLocation    = new Vector2(6, 0);
            Vector2 downLocation  = new Vector2(6, 9);
            Vector2 leftLocation  = new Vector2(-1, 4.5f);
            Vector2 rightLocation = new Vector2(13, 4.5f);

            for (int k = 0; k < width; k++)
            {
                if (k < length)
                {
                    Walls.Add(new Wall(new Vector2(leftLocation.X * XSCALE + doorOffset.X + XOFFSET, k * YSCALE - doorOffset.Y + YOFFSET)));
                    Walls.Add(new Wall(new Vector2(rightLocation.X * XSCALE + doorOffset.X + XOFFSET, k * YSCALE - doorOffset.Y + YOFFSET)));
                }
                Walls.Add(new Wall(new Vector2((k * XSCALE) + doorOffset.X + XOFFSET, upLocation.Y * YSCALE - doorOffset.Y + YOFFSET)));
                Walls.Add(new Wall(new Vector2((k * XSCALE) + doorOffset.X + XOFFSET, downLocation.Y * YSCALE - doorOffset.Y + YOFFSET)));
            }
        }
예제 #23
0
        private void AddWalls()
        {
            Block wall1 = new Block(new Vector3(0f, 0f, 1.5f) + Position, BasePosition, new Quaternion(0f, -0.7071068f, 0f, 0.7071068f), foundationSize, buildingHeight, Prefab.Wall, 0);

            Walls.Add(wall1);

            Block wall2 = new Block(new Vector3(-1.5f, 0f, 0f) + Position, BasePosition, new Quaternion(0f, 1f, 0f, 0f), foundationSize, buildingHeight, Prefab.Wall, 0);

            Walls.Add(wall2);

            if (BasePosition.z == 0)
            {
                Block wall3 = new Block(new Vector3(0f, 0f, -1.5f) + Position, BasePosition, new Quaternion(0f, -0.7071068f, 0f, 0.7071068f), foundationSize, buildingHeight, Prefab.Wall, 0);
                Walls.Add(wall3);
            }

            if (BasePosition.x + 1 == foundationSize)
            {
                Block wall4 = new Block(new Vector3(1.5f, 0f, 0f) + Position, BasePosition, new Quaternion(0f, 1f, 0f, 0f), foundationSize, buildingHeight, Prefab.Wall, 0);
                Walls.Add(wall4);
            }
        }
예제 #24
0
        //敵オブジェクト配置
        void CreateObject(asd.Vector2DF position, int obj)
        {
            switch (obj)
            {
            case 0:
                Walls.Add(new Wall(position));
                LayerOfMain.AddObject(Walls[Walls.Count - 1]);
                SetWallRainColligeData(Walls[Walls.Count - 1].Position);
                break;

            case 1:
                Clouds.Add(new Cloud(position, TypeOfCloud.Small));
                LayerOfMain.AddObject(Clouds[Clouds.Count - 1]);
                break;

            case 2:
                Clouds.Add(new Cloud(position, TypeOfCloud.Medium));
                LayerOfMain.AddObject(Clouds[Clouds.Count - 1]);
                break;

            case 3:
                Clouds.Add(new Cloud(position, TypeOfCloud.Large));
                LayerOfMain.AddObject(Clouds[Clouds.Count - 1]);
                break;

            case 4:
                break;

            case 5:
                Healers.Add(new Healer(position));
                LayerOfMain.AddObject(Healers[Healers.Count - 1]);
                break;

            case 6:
                Winds.Add(new Wind(position));
                LayerOfMain.AddObject(Winds[Winds.Count - 1]);
                break;
            }
        }
예제 #25
0
파일: Map.cs 프로젝트: Zopherus/Pacapong
        public static void InitializeMap()
        {
            Walls.Clear();
            Nodes.Clear();
            EmptySquares.Clear();
            Dots.Clear();
            Powerups.Clear();
            Ghosts.Clear();
            Invaders.Clear();
            //Initializes border of map
            string line   = "";
            int    number = 0;

            using (StreamReader sr = new StreamReader("Maps/pacman" + PacmanGame.maps[PacmanGame.mapNumber].ToString() + ".txt"))
            {
                while (true)
                {
                    line = sr.ReadLine();
                    if (line == null)
                    {
                        break;
                    }
                    for (int counter = 0; counter < line.Length; counter++)
                    {
                        wallMap[counter, number] = line[counter].ToString() == "0";
                    }
                    number++;
                }
            }
            //Fills in rest of map using two dimensional bool array wallMap
            for (int x = 0; x < wallMap.GetLength(0); x++)
            {
                for (int y = 0; y < wallMap.GetLength(1); y++)
                {
                    if (!wallMap[x, y])
                    {
                        Walls.Add(new Wall(new Rectangle(x * PacmanGame.gridSize + PacmanGame.horizontalSpace, y * PacmanGame.gridSize + PacmanGame.verticalSpace, PacmanGame.gridSize, PacmanGame.gridSize)));
                    }
                }
            }
            //Fills map with empty squares, dots and nodes in all places without walls
            //variable used to count nodes
            int variable = 0;

            for (int y = 1; y < PacmanGame.mapHeight / PacmanGame.gridSize - 1; y++)
            {
                for (int x = 1; x < PacmanGame.mapWidth / PacmanGame.gridSize - 1; x++)
                {
                    Rectangle rectangle = new Rectangle(PacmanGame.gridSize * x + PacmanGame.horizontalSpace, PacmanGame.gridSize * y + PacmanGame.verticalSpace, PacmanGame.gridSize, PacmanGame.gridSize);
                    bool      value     = true;
                    foreach (Wall wall in Walls)
                    {
                        if (wall.Position == rectangle)
                        {
                            value = false;
                        }
                    }
                    if (value)
                    {
                        EmptySquares.Add(new EmptySquare(rectangle));
                        Dots.Add(new Dot(rectangle));
                        Nodes.Add(new Node(variable, rectangle));
                        variable++;
                    }
                }
            }
            //Remove the dot where the pacman starts
            Dots.Remove(new Dot(new Rectangle(PacmanGame.gridSize, PacmanGame.gridSize, PacmanGame.gridSize, PacmanGame.gridSize)));
            //Adds powerups
            Random random = new Random();

            int[] values = Enumerable.Range(0, Map.Nodes.Count).OrderBy(x => random.Next()).ToArray();
            for (int counter = 0; counter < 4; counter++)
            {
                int       index          = values[counter];
                Rectangle rectangleValue = Map.Nodes.ElementAt(index).Position;
                Powerups.Add(new Powerup(rectangleValue));
                //Remove the dot where the powerup is
                Dots.Remove(new Dot(rectangleValue));
            }

            createAdjacencyList();

            Paddles[0] = new Paddle(new Rectangle(PacmanGame.horizontalSpace / 2, PacmanGame.screenHeight / 2, PacmanGame.gridSize, PacmanGame.gridSize * 5), Player.Left);
            Paddles[1] = new Paddle(new Rectangle(PacmanGame.screenWidth - PacmanGame.horizontalSpace / 2, PacmanGame.screenHeight / 2, PacmanGame.gridSize, PacmanGame.gridSize * 5), Player.Right);
        }
예제 #26
0
 public void AddWall(Wall w)
 {
     Walls.Add(w);
 }
예제 #27
0
        public Scene8(int Width, int Height)
            : base(4, 11, 90, 90, Width, Height, Color.FromArgb(232, 240, 240))
        {
            // TOP
            for (int i = 0; i < 11; ++i)
            {
                Walls.Add(new Wall(new Rectangle((i * ColumnWidth) + Scene.LEFT, Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            }

            // BOTTOM
            for (int i = 0; i < 11; ++i)
            {
                Walls.Add(new Wall(new Rectangle(i * ColumnWidth + Scene.LEFT, Rows * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            }

            // LEFT
            for (int i = 0; i < 4; ++i)
            {
                Walls.Add(new Wall(new Rectangle(Scene.LEFT, i * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));
            }

            // RIGHT
            for (int i = 0; i < 4; ++i)
            {
                Walls.Add(new Wall(new Rectangle(Scene.LEFT + Columns * ColumnWidth, i * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));
            }


            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            // OUTER TOP
            for (int i = 0; i < 11; ++i)
            {
                DecorWalls.Add(new Wall(new Rectangle((i * ColumnWidth) + Scene.LEFT, Scene.TOP - 16, ColumnWidth, 16), Resources.Scene7_OuterWallTop));
            }

            // OUTER BOTTOM
            for (int i = 0; i < 11; ++i)
            {
                DecorWalls.Add(new Wall(new Rectangle(i * ColumnWidth + Scene.LEFT, Rows * RowHeight + Scene.TOP + 6, ColumnWidth, 16), Resources.Scene7_OuterWallBottom));
            }

            // OUTER LEFT
            for (int i = 0; i < 4; ++i)
            {
                DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT - 16, i * RowHeight + Scene.TOP, 16, RowHeight), Resources.Scene7_OuterWallLeft));
            }

            // OUTER RIGHT
            for (int i = 0; i < 4; ++i)
            {
                DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + Columns * ColumnWidth + 6, i * RowHeight + Scene.TOP, 16, RowHeight), Resources.Scene7_OuterWallRight));
            }



            ////////////////////////////////////////////////////////////////////////////////
            // ADDING LINES INSIDE
            // FIRST COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * ColumnWidth, 2 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * ColumnWidth, 3 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));

            // SECOND COLUMN
            // HORIZONTAL

            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 2 * ColumnWidth, 3 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));

            // THIRD COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 2 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 2 * ColumnWidth, 2 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * ColumnWidth, 3 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));


            // FOURTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 4 * ColumnWidth, 3 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));


            // FIFTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 4 * ColumnWidth, 2 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 5 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));


            // SIXTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 5 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 5 * ColumnWidth, 2 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 6 * ColumnWidth, 3 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));


            // SEVENTH COLUMN
            // HORIZONTAL

            // VERTICAL



            // EIGHTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 7 * ColumnWidth, 2 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 7 * ColumnWidth, 3 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 8 * ColumnWidth, 0 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 8 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));


            // NINTH COLUMN
            // HORIZONTAL

            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 9 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 9 * ColumnWidth, 3 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));


            // TENTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 9 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 10 * ColumnWidth, 0 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 10 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 10 * ColumnWidth, 2 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene8_InnerWallVertical));


            // ELEVENTH COLUMN
            // HORIZONTAL

            // VERTICAL


            //// TWELVETH COLUMN
            //// HORIZONTAL
            //Walls.Add(new Wall(new Rectangle(Scene.LEFT + 11 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            //Walls.Add(new Wall(new Rectangle(Scene.LEFT + 11 * ColumnWidth, 3 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene8_InnerWallHorizontal));
            //// VERTICAL



            ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            // ANGLES OF SCENE DECOR
            // TOP-LEFT
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT - 16, Scene.TOP - 16, 19, 19), Resources.Scene7_TopLeft));

            // TOP-RIGHT
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + Columns * ColumnWidth + 2, Scene.TOP - 17, 19, 19), Resources.Scene7_TopRight));

            // BOTTOM-LEFT
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT - 16, Rows * RowHeight + Scene.TOP + 2, 19, 19), Resources.Scene7_BottomLeft));

            // BOTTOM-RIGHT
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + Columns * ColumnWidth + 3, Rows * RowHeight + Scene.TOP + 3, 19, 19), Resources.Scene7_BottomRight));
        }
예제 #28
0
 /// <summary>
 /// Fügt die übergeben Wand zum Labyrinth hinzu
 /// </summary>
 /// <param name="wall">Wand, die zum Labyrinth hinzugefügt werden soll</param>
 public void AddWall(MazeWall wall)
 {
     Walls.Add(wall);
 }
예제 #29
0
        public Scene5(int Width, int Height)
            : base(6, 10, 90, 90, Width, Height, Color.FromArgb(232, 240, 240))
        {
            for (int i = 0; i < 10; ++i)
            {
                Walls.Add(new Wall(new Rectangle((i * ColumnWidth) + Scene.LEFT, Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            }

            // BOTTOM
            for (int i = 0; i < 10; ++i)
            {
                Walls.Add(new Wall(new Rectangle(i * ColumnWidth + Scene.LEFT, Rows * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            }

            // LEFT
            for (int i = 0; i < 6; ++i)
            {
                Walls.Add(new Wall(new Rectangle(Scene.LEFT, i * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            }

            // RIGHT
            for (int i = 0; i < 6; ++i)
            {
                Walls.Add(new Wall(new Rectangle(Scene.LEFT + Columns * ColumnWidth, i * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            }


            // ADDING LINES INSIDE
            // FIRST COLUMN
            // HORIZONTAL

            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * ColumnWidth, 2 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * ColumnWidth, 5 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));

            // SECOND COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * ColumnWidth, 3 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * ColumnWidth, 4 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 2 * ColumnWidth, 5 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));

            // THIRD COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 2 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 2 * ColumnWidth, 5 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * ColumnWidth, 0 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * ColumnWidth, 4 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));


            // FOURTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * ColumnWidth, 5 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 4 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 4 * ColumnWidth, 4 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));

            // FIFTH COLUMN
            // HORIZONTAL

            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 5 * ColumnWidth, 3 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));


            // SIXTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 5 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 5 * ColumnWidth, 2 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 5 * ColumnWidth, 4 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 6 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 6 * ColumnWidth, 2 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 6 * ColumnWidth, 4 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));


            // SEVENTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 6 * ColumnWidth, 5 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 7 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));


            // EIGHTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 7 * ColumnWidth, 2 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 7 * ColumnWidth, 3 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 7 * ColumnWidth, 4 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            // VERTICAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 8 * ColumnWidth, 1 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 8 * ColumnWidth, 5 * RowHeight + Scene.TOP, 6, RowHeight), Resources.Scene5_VerticalWall));


            // NINTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 8 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 8 * ColumnWidth, 3 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 8 * ColumnWidth, 4 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            // VERTICAL

            // TENTH COLUMN
            // HORIZONTAL
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 9 * ColumnWidth, 1 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 9 * ColumnWidth, 3 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 9 * ColumnWidth, 4 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            Walls.Add(new Wall(new Rectangle(Scene.LEFT + 9 * ColumnWidth, 5 * RowHeight + Scene.TOP, ColumnWidth, 6), Resources.Scene5_HorizontalWall));
            // VERTICAL


            // OUT OF SCENE DECOR
            // TOP
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + 0 * 270, Scene.TOP - 17, 270, 17), Resources.Scene1_TopDecor));
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * 270, Scene.TOP - 17, 270, 17), Resources.Scene1_TopDecor));
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + 2 * 270, Scene.TOP - 17, 270, 17), Resources.Scene1_TopDecor));
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * 270, Scene.TOP - 17, 90, 17), Resources.Scene1_TopDecor));

            // RIGHT
            int offset = 0;

            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + Columns * ColumnWidth + 6, Scene.TOP + offset, 17, 270), Resources.Scene1_RightDecor));
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + Columns * ColumnWidth + 6, Scene.TOP + 1 * 270 + offset, 17, 270), Resources.Scene1_RightDecor));

            // BOTTOM
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + 0 * 270, Scene.TOP + Rows * RowHeight + 6, 270, 17), Resources.Scene1_BottomDecor));
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + 1 * 270, Scene.TOP + Rows * RowHeight + 6, 270, 17), Resources.Scene1_BottomDecor));
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + 2 * 270, Scene.TOP + Rows * RowHeight + 6, 270, 17), Resources.Scene1_BottomDecor));
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT + 3 * 270, Scene.TOP + Rows * RowHeight + 6, 90, 17), Resources.Scene1_BottomDecor));

            // LEFT
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT - 17, Scene.TOP + offset, 17, 270), Resources.Scene1_LeftDecor));
            DecorWalls.Add(new Wall(new Rectangle(Scene.LEFT - 17, Scene.TOP + 1 * 270 + offset, 17, 270), Resources.Scene1_LeftDecor));
        }
예제 #30
0
 private void AddWall(Wall w)
 {
     Walls.Add(w);
 }