public override void LoadContent(ContentManager content) { #region PlayerInstantiation //AtlasTest Texture2D playerAtlas = content.Load <Texture2D>("Models/ZetaGundam_Atlas_64"); Texture2D gruntAtlas = content.Load <Texture2D>("Models/ZakuII_Atlas_64Flipped"); _player = Factory.CreatePlayer(playerAtlas); List <int> wayPointIndexes = new List <int>() { 0, 1 }; ISprite gruntMelee = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes); ISprite gruntRanged = new GruntRanged(gruntAtlas); _font = content.Load <SpriteFont>("Font"); _camera = new PlayerCamera(_graphicsDeviceManager); _scoreDisplayer = new HudDisplayer(_camera, _font); #endregion _sprites = new List <ISprite> { _player, gruntMelee, gruntRanged }; _map = new TmxMap("Maps/Tiled/TutorialMap.tmx"); List <Tileset> tileSets = new List <Tileset>(); foreach (TmxTileset tileset in _map.Tilesets) { Texture2D tileSetTexture = content.Load <Texture2D>("maps/Tilesets/" + tileset.Name.ToString()); tileSets.Add(new Tileset(tileSetTexture, tileset)); } Texture2D background = content.Load <Texture2D>("Backgrounds/LevelBackground1"); _mapManager = new MapManager(_map, tileSets, background, _sprites); Vector2 spawnPoint = _mapManager.GetSpawnPoint(0); }
public override void LoadContent(ContentManager content) { #region PlayerInstantiation Texture2D playerAtlas = content.Load <Texture2D>("Models/ZetaGundam_Atlas_64"); //player = Factory.CreatePlayer(playerAtlas); _font = content.Load <SpriteFont>("Font"); _camera = new PlayerCamera(_graphicsDeviceManager); _scoreDisplayer = new HudDisplayer(_camera, _font); #endregion #region EnemyInstantiation Texture2D gruntAtlas = content.Load <Texture2D>("Models/ZakuII_Atlas_64Flipped"); List <int> wayPointIndexes0 = new List <int>() { 0, 1 }; ISprite gruntMelee0 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes0); List <int> wayPointIndexes1 = new List <int>() { 2, 3 }; ISprite gruntMelee1 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes1); ISprite gruntRanged0 = new GruntRanged(gruntAtlas); List <int> wayPointIndexes2 = new List <int>() { 4, 5 }; ISprite gruntMelee2 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes2); List <int> wayPointIndexes3 = new List <int>() { 6, 7 }; ISprite gruntMelee3 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes3); ISprite gruntRanged1 = new GruntRanged(gruntAtlas); List <int> wayPointIndexes4 = new List <int>() { 8, 9 }; ISprite gruntMelee4 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes4); List <int> wayPointIndexes5 = new List <int>() { 10, 11 }; ISprite gruntMelee5 = Factory.CreateGruntMelee(gruntAtlas, wayPointIndexes5); #endregion #region MapInstantiation _sprites = new List <ISprite> { _player, gruntMelee0, gruntMelee1, gruntRanged0, gruntMelee2, gruntMelee3, gruntRanged1, gruntMelee4, gruntMelee5, }; _map = new TmxMap("Maps/Tiled/Level1v2.tmx"); List <Tileset> tileSets = new List <Tileset>(); foreach (TmxTileset tileset in _map.Tilesets) { Texture2D tileSetTexture = content.Load <Texture2D>("maps/Tilesets/" + tileset.Name.ToString()); tileSets.Add(new Tileset(tileSetTexture, tileset)); } Texture2D background = content.Load <Texture2D>("Backgrounds/LevelBackground1"); _mapManager = new MapManager(_map, tileSets, background, _sprites); #endregion }