Example #1
0
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            Animation animation = new Animation(content, true, .4f, 1.0f);

            animation.AddTexture(GameSettings.GetGameSettings().ImagesPath + "Map/Tile33");
            animation.AddTexture(GameSettings.GetGameSettings().ImagesPath + "Map/Tile34");

            AddAnimation(animation);

            SetActiveAnimation(0);

            IsActive = true;
        }
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            GameSettings gameSettings = GameSettings.GetGameSettings();

            string[] textureNames = null;

            if (_SpriteType == SpriteType.Blinkey)
            {
                textureNames = new string[] { "Blinky/GHOSTA_LEFT", "Blinky/GHOSTA_RIGHT", "Blinky/GHOSTA_UP", "Blinky/GHOSTA_DOWN" };
            }
            if (_SpriteType == SpriteType.Pinkey)
            {
                textureNames = new string[] { "Pinky/GHOSTA_LEFT", "Pinky/GHOSTA_RIGHT", "Pinky/GHOSTA_UP", "Pinky/GHOSTA_DOWN" };
            }
            if (_SpriteType == SpriteType.Clyde)
            {
                textureNames = new string[] { "Clyde/GHOSTA_LEFT", "Clyde/GHOSTA_RIGHT", "Clyde/GHOSTA_UP", "Clyde/GHOSTA_DOWN" };
            }
            if (_SpriteType == SpriteType.Inky)
            {
                textureNames = new string[] { "Inky/GHOSTA_LEFT", "Inky/GHOSTA_RIGHT", "Inky/GHOSTA_UP", "Inky/GHOSTA_DOWN" };
            }

            int i = 0;

            for (i = 0; i < textureNames.Length; i++)
            {
                Animation animation = new Animation(content, true, .08f, 1f);

                for (int j = 1; j <= 2; j++)
                {
                    animation.AddTexture(gameSettings.ImagesPath + textureNames[i] + j.ToString());
                }

                AddAnimation(animation);
            }

            textureNames = new string[] { "BlueGhost/GHOSTA_LEFT", "BlueGhost/GHOSTA_RIGHT", "BlueGhost/GHOSTA_UP", "BlueGhost/GHOSTA_DOWN" };

            for (i = 0; i < textureNames.Length; i++)
            {
                Animation animation = new Animation(content, true, .08f, 1f);

                for (int j = 1; j <= 2; j++)
                {
                    animation.AddTexture(gameSettings.ImagesPath + textureNames[i] + j.ToString());
                }

                AddAnimation(animation);
            }
        }
        public override void Load(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            GameSettings gameSettings = GameSettings.GetGameSettings();

            if (_SpriteType == SpriteType.PacMan)
            {
                string[] textureNames = new string[] { "Pacman/PACMAN_LEFT", "Pacman/PACMAN_RIGHT", "Pacman/PACMAN_UP", "Pacman/PACMAN_DOWN" };

                for (int i = 0; i < textureNames.Length; i++)
                {
                    Animation animation = new Animation(content, true, .08f, 1f);

                    for (int j = 1; j <= 4; j++)
                    {
                        animation.AddTexture(gameSettings.ImagesPath + textureNames[i] + j.ToString());
                    }

                    AddAnimation(animation);
                }
            }
        }