示例#1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="level"></param>
        /// <param name="position"></param>
        /// <param name="spriteSet">Which sprite sheet to use for animations. Different monsters etc</param>
        public Enemy(Level level, Vector2 position, string spriteSet)
        {
            this.level = level;
            this.position = position;

            LoadContent(spriteSet);

            active = true;
        }
示例#2
0
 public Player(Level level, Vector2 position)
 {
     this.level = level;
     LoadContent();
     Reset(position);
 }
示例#3
0
        private void LoadNextLevel()
        {
            // move to the next level
            levelIndex = (levelIndex + 1) % numberOfLevels;

            // Unload the content of the current level, then load the next one
            if (level != null)
                level.Dispose();

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