Exemple #1
0
        // -------------------------------------------------------------------
        // CopyPassable
        // -------------------------------------------------------------------

        public TilesetPassage[,] CopyPassable()
        {
            TilesetPassage[,] array = new TilesetPassage[PassableCollision.GetLength(0), PassableCollision.GetLength(1)];

            for (int i = 0; i < PassableCollision.GetLength(0); i++)
            {
                for (int j = 0; j < PassableCollision.GetLength(1); j++)
                {
                    array[i, j] = PassableCollision[i, j].CreateCopy();
                }
            }

            return(array);
        }
Exemple #2
0
        // -------------------------------------------------------------------
        // GetDefaultPassableCollision
        // -------------------------------------------------------------------

        public static TilesetPassage[,] GetDefaultPassableCollision(int width, int height)
        {
            TilesetPassage[,] array = new TilesetPassage[width, height];

            for (int i = 0; i < width; i++)
            {
                for (int j = 0; j < height; j++)
                {
                    array[i, j] = new TilesetPassage();
                }
            }

            return(array);
        }
Exemple #3
0
        // -------------------------------------------------------------------
        // GetPassageColision
        // -------------------------------------------------------------------

        public Collision GetPassageColision(Collision collision)
        {
            TilesetPassage[,] newPassage = new TilesetPassage[passagePicture.Width / WANOK.BASIC_SQUARE_SIZE, passagePicture.Height / WANOK.BASIC_SQUARE_SIZE];

            for (int i = 0; i < newPassage.GetLength(0); i++)
            {
                for (int j = 0; j < newPassage.GetLength(1); j++)
                {
                    if (i < collision.PassableCollision.GetLength(0) && j < collision.PassableCollision.GetLength(1))
                    {
                        newPassage[i, j] = collision.PassableCollision[i, j].CreateCopy();
                    }
                    else
                    {
                        newPassage[i, j] = new TilesetPassage();
                    }
                }
            }

            return(new Collision(newPassage));
        }