예제 #1
0
파일: Player.cs 프로젝트: kazha/Pearl
        /// <summary>
        /// Constructors a new player.
        /// </summary>
        public Player(Level level, Vector2 position)
        {
            this.level = level;

            LoadContent();

            Reset(position);
        }
예제 #2
0
파일: Core.cs 프로젝트: 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);
            }
        }