示例#1
0
        /// <summary>
        /// constructer
        /// </summary>
        /// <param name="BmpPath"></param>
        public Level(string BmpPath)
        {
            //set color map from bitmap
            colorMap = ImageLoad.LoadArray(BmpPath);

            //create tile map with same dimensions as color map
            tiles = new Tile[colorMap.GetLength(0), colorMap.GetLength(1)];
        }
示例#2
0
        /// <summary>
        /// reset to a new level
        /// </summary>
        /// <param name="bmpPath"></param>
        public void Reset(string bmpPath)
        {
            exits.Clear();
            grabberEnemies.Clear();
            waterTiles.Clear();

            colorMap = ImageLoad.LoadArray(bmpPath);

            tiles = new Tile[colorMap.GetLength(0), colorMap.GetLength(1)];

            Player.Save();

            LoadLevel();
        }