/// <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; }
public Player(Level level, Vector2 position) { this.level = level; LoadContent(); Reset(position); }
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); }