protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); //LOAD XML ElementCollection.ReadDocument(XDocument.Load("Content/XML/Items.xml")); ElementCollection.ReadDocument(XDocument.Load("Content/XML/MiscEntities.xml")); ElementCollection.ReadDocument(XDocument.Load("Content/XML/Pickups.xml")); ElementCollection.ReadDocument(XDocument.Load("Content/XML/Spritesheets.xml")); SpriteSheetCollection.ReadDocument(XDocument.Load("Content/XML/Spritesheets.xml"), Content); SoundManager.AddEffect(Content.Load <SoundEffect>("SFX/hit1"), "hit1"); SoundManager.AddEffect(Content.Load <SoundEffect>("SFX/hit2"), "hit2"); SoundManager.AddEffect(Content.Load <SoundEffect>("SFX/hit3"), "hit3"); SoundManager.AddEffect(Content.Load <SoundEffect>("SFX/hit4"), "hit4"); SoundManager.AddEffect(Content.Load <SoundEffect>("SFX/hit5"), "hit5"); SoundManager.AddEffect(Content.Load <SoundEffect>("SFX/hit6"), "hit6"); SoundManager.AddEffect(Content.Load <SoundEffect>("SFX/hit7"), "hit7"); SoundManager.AddSong(Content.Load <Song>("Music/dungeonrun"), "gamesong"); SoundManager.AddSong(Content.Load <Song>("Music/menusong"), "menusong"); SoundManager.PlaySong("menusong"); RecipeBook.ReadDocument(XDocument.Load("Content/XML/Recipes.xml")); //LOAD TEXTURES ParticleSystem.AcquireTxture(SpriteSheetCollection.GetTex("appear", "slotappears", "slot")); ParticleSystem.AcquireTxture(SpriteSheetCollection.GetTex("stars", "miscsheet1", "particle")); scoretex = SpriteSheetCollection.GetTex("score", "score", "button"); //LOAD SOUND //LOAD ENTITIES //LOAD UR MOM SetupUISystems(); //END - SETUP THE GAME! SetupGame(); }
void CheckRecipes(List <string> pool) { Recipe r = RecipeBook.FindRecipe(pool); if (r != null) { //do stuff foreach (string rname in r.ingredients) { for (int x = items.Count - 1; x >= 0; x--) { if (items[x].Name == rname) { items[x].exists = false; items.RemoveAt(x); break; } } } AddItem(Assembler.GetEnt(ElementCollection.GetEntRef(r.result), Vector2.Zero, content, new EntBuilder42())); } }