public override void LoadContent() { if (_content == null) _content = new ContentManager(ScreenManager.Game.Services, "Content"); //_gameFont = _content.Load<SpriteFont>(@"Fonts\gamefont"); _gameSound = _content.Load<Song>(@"SFX\gameSound"); MediaPlayer.IsRepeating = true; MediaPlayer.Volume = Settings.MainVolume; MediaPlayer.Play(_gameSound); _CreateWorld(); World.Selection.LoadContent(_content); MapObjectLayer objects = World.Map.GetLayer("Objects") as MapObjectLayer; if (objects != null) { MapObject headQuarterLocation = objects.GetObject("HQ"); World.HeadQuarter = new HeadQuarter(new Vector2(headQuarterLocation.Bounds.X, headQuarterLocation.Bounds.Y), @"Textures\Buildings\HQ", 300, 500, 999, 500, 999); World.HeadQuarter.LoadContent(_content); World.ResourcesManager = new ResourcesManager(World.HeadQuarter); World.ResourcesManager.LoadContent(_content); foreach (MapObject obj in objects.GetObjectsByType("Village")) { int initFood = Convert.ToInt32(obj.Properties["Food"].RawValue); int initMedicine = Convert.ToInt32(obj.Properties["Medicine"].RawValue); int initPopulation = Convert.ToInt32(obj.Properties["Population"].RawValue); Village village = new Village(new Vector2(obj.Bounds.X, obj.Bounds.Y), initFood, 999, initMedicine, 999, initPopulation); village.LoadContent(_content); World.Sprites.Add(village); } World.Sprites.Add(World.HeadQuarter); } World.Camera.Focus(World.HeadQuarter.Position); World.LoadCollisionClip(); World.Time = new WorldTime(12, 10, 2012, 6, 0); // once the load has finished, we use ResetElapsedTime to tell the game's // timing mechanism that we have just finished a very long frame, and that // it should not try to catch up. ScreenManager.Game.ResetElapsedTime(); }