Esempio n. 1
0
        public override void LoadContent(ContentManager content)
        {
            // Load the coin animation.
            DrawableSet.LoadDrawableSetXml(this.Drawables, "Animations/Misc/coin.anim", content);

            CoinSound = content.Load <SoundEffect>("Sounds/Coins/coin1");
        }
        public static void LoadRepositoryXml(string filePath, ContentManager content)
        {
            XmlDocument document = new XmlDocument();

            document.Load(filePath);

            foreach (XmlNode itemNode in document.SelectNodes("ItemRepository/Item"))
            {
                Item item = new Item();
                item.Name = XmlExtensions.GetAttributeValue(itemNode, "Name", null, true);

                item.FriendlyName = itemNode.SelectSingleNode("FriendlyName").InnerText;
                item.Description  = itemNode.SelectSingleNode("Description").InnerText;
                item.Weight       = XmlExtensions.GetAttributeValue <float>(itemNode, "Weight", 0);
                item.ItemType     = (ItemType)Enum.Parse(typeof(ItemType), XmlExtensions.GetAttributeValue(itemNode, "ItemType", null, true));

                foreach (XmlNode drawableSetNode in itemNode.SelectNodes("Drawables/Drawable"))
                {
                    string src = XmlExtensions.GetAttributeValue(drawableSetNode, "src");
                    DrawableSet.LoadDrawableSetXml(item.Drawables, src, content);
                }

                GameItems.Add(item.Name, item);
            }
        }
Esempio n. 3
0
        public override void LoadContent(ContentManager content)
        {
            double startTimeMS = randomGenerator.NextDouble() * 4000;

            DrawableSet.LoadDrawableSetXml(
                Drawables,
                "Animations/Monsters/bat.anim",
                content, startTimeMS
                );

            CurrentDrawableState = "Left";
        }
Esempio n. 4
0
        public override void LoadContent(ContentManager content)
        {
            // Load the animation
            DrawableSet.LoadDrawableSetXml(Drawables, ANIMATION, content);

            foreach (GameDrawableInstance instance in Drawables.GetByGroup("Body"))
            {
                if (instance.Drawable is Animation)
                {
                    Animation anim = (Animation)instance.Drawable;
                    //anim.onAnimationFinished += new Animation.AnimationFinishedEventHandler(anim_onAnimationFinished);
                }
            }


            CurrentDrawableState = "Idle_" + Direction;

            base.LoadContent(content);
        }
Esempio n. 5
0
        public override void LoadContent(ContentManager content)
        {
            DrawableSet.LoadDrawableSetXml(Drawables, BaseRace, content);

            CurrentDrawableState = "Idle_Left";
        }
Esempio n. 6
0
 public override void LoadContent(ContentManager content)
 {
     DrawableSet.LoadDrawableSetXml(Drawables, "Animations/Misc/chests.anim", content);
     CurrentDrawableState = "Closed";
 }