Exemplo n.º 1
0
        /// <summary>
        /// Constructors a new player.
        /// </summary>
        public Player(Level level, Vector2 position)
        {
            this.level = level;

            LoadContent();

            Reset(position);
        }
Exemplo n.º 2
0
Arquivo: Core.cs Projeto: kazha/Pearl
        private void LoadNextLevel()
        {
            // move to the next level
            this._levelIndex = (this._levelIndex + 1) % _numberOfLevels;

            // Unloads the content for the current level before loading the next one.
            if (this._level != null)
            {
                this._level.Dispose();
            }

            // Load the level.
            string levelPath = string.Format("Content/Levels/{0}.txt", this._levelIndex);
            using (Stream fileStream = TitleContainer.OpenStream(levelPath))
            {
                this._level = new Level(Services, fileStream, _levelIndex);
            }
        }