/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here Bounds = GraphicsDevice.Viewport.Bounds; //LevelParser.ParseTextFile("test.level"); ContentManager manager = new ContentManager(this.Services, "Content"); splash = manager.Load<Texture2D>("splash"); gameOver = manager.Load<Texture2D>("game_over_bg"); _currentLevel = new Level(1); tileMap = LevelParser.ParseTileMap(this, "tilemap", 32); /* * Add Levels */ levels = new List<RawLevel>(); levels.Add(LevelParser.ParseTextFile("../../../../EpheremalContent/firstlevel.level")); levels.Add(LevelParser.ParseTextFile("../../../../EpheremalContent/secondlevel.level")); levels.Add(LevelParser.ParseTextFile("../../../../EpheremalContent/mario.level")); //levels.Add(LevelParser.ParseTextFile("../../../../EpheremalContent/georges.level")); levels.Add(LevelParser.ParseTextFile("../../../../EpheremalContent/matt2.level")); levels.Add(LevelParser.ParseTextFile("../../../../EpheremalContent/jump.level")); levels.Add(LevelParser.ParseTextFile("../../../../EpheremalContent/bounce.level")); levels.Add(LevelParser.ParseTextFile("../../../../EpheremalContent/boss.level")); loadedLevel = false; /* * Create Player */ Player = new Player(tileMap, 557, 557); base.Initialize(); }
public void SetLevel(Level level) { this._level = level; }