예제 #1
0
        private void InitLevel(TileField tf = null)
        {
            if (tf == null)
            {
                tf = CreateTileField();
            }

            //Resize and reposition the level to prevent it from overlapping with the controls
            level                = new EditorLevel(tf, 0, VisibleLevelArea);
            level.Position      += new Vector2(TILES_LIST_WIDTH, 0);
            level.Player.OnMove += PlayerMoved;
        }
예제 #2
0
        private TileField CreateTileField()
        {
            TileField tf;

            if (newLevelBox == null)
            {
                tf = new TileField(Level.DEFAULT_NUM_ROWS, Level.DEFAULT_NUM_COLS);
            }
            else
            {
                tf = new TileField(newLevelBox.Rows, newLevelBox.Columns);
            }
            EditorLevel.FillWithEmptyTiles(tf);
            return(tf);
        }