예제 #1
0
        private GameLayerTiled _mainLayer; // Main GameLayer, containing TileSystem and game activity

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Create a new GameLevel with the specified TileSystem properties
        /// </summary>
        /// <param name="numRows">Number of tile rows</param>
        /// <param name="numCols">Number of tile columns</param>
        /// <param name="defaultTileReferenceCode">Default tile to populate the level</param>
        public GameLevel(GameScreen gameScreen, int numRows, int numCols, byte defaultTileReferenceCode)
        {
            Construct(gameScreen);
            NewLevel(numRows, numCols, defaultTileReferenceCode);
        }
예제 #2
0
 /// <summary>
 /// Load a GameLevel from a file
 /// </summary>
 /// <param name="filename">File to load from</param>
 public GameLevel(GameScreen gameScreen, string filename)
 {
     Construct(gameScreen);
     LoadLevel(filename);
 }
예제 #3
0
 /// <summary>
 /// Common constructor code
 /// Should be called by all constructors
 /// </summary>
 private void Construct(GameScreen gameScreen)
 {
     _gameScreen = gameScreen;               // Set the game screen to the screen that brought us here
     _gameLayers = new List<GameLayer>();    // Initialize GameLayers list so we can add to it
 }