Example #1
0
        public void Init(ContentManager content, String strPreTextures,
                         int textureCount, Vector2 size, int maxLength, int type, int damage)
        {
            this.maxLength = maxLength;
            this.skillType = type;
            this.damage    = damage;
            SpritesCount   = 1;
            TopLeft        = Vector2.Zero;
            Size           = size;
            String[] strTextures = new String[textureCount];
            for (int i = 0; i < textureCount; i++)
            {
                strTextures[i] = strPreTextures + (i + 1).ToString("00");
            }
            Texture2D[] textures = new Texture2D[textureCount];
            for (int i = 0; i < textureCount; i++)
            {
                textures[i] = content.Load <Texture2D>(strTextures[i]);
            }

            Sprites = new List <My2DSprite>();
            My2DSprite temp = new My2DSprite(textures, TopLeft);

            Sprites.Add(temp);
            SpritesCount = 1;
        }
Example #2
0
        public Cell(ContentManager content, String strMap, Vector2 topleft, Vector2 size, int type, int skill)
        {
            TopLeft = topleft;
            Size    = size;
            Texture2D[] textures = new Texture2D[1];
            textures[0] = content.Load <Texture2D>(strMap);
            Sprites     = new List <My2DSprite>();
            My2DSprite temp = new My2DSprite(textures, TopLeft);

            temp.Size = this.Size;
            Sprites.Add(temp);
            SpritesCount   = 1;
            _type          = type;
            this.SkillType = skill;
        }
Example #3
0
        private void InitMyButton(SpriteFont font, String text, ContentManager content, String[] strTextures, int textureCount, ref Vector2 topLeft, ref Vector2 size)
        {
            TopLeft = topLeft;
            Size    = size;
            Text    = text;
            Font    = font;

            Texture2D[] textures = new Texture2D[textureCount];
            for (int i = 0; i < textureCount; i++)
            {
                textures[i] = content.Load <Texture2D>(strTextures[i]);
            }

            Sprites = new List <My2DSprite>();
            My2DSprite temp = new My2DSprite(textures, TopLeft);

            Sprites.Add(temp);
            SpritesCount = 1;
            _color       = Color.White;
            IsSelected   = false;
        }
Example #4
0
        public void Init(ContentManager content, String strPreTextures,
                         int textureCount, Vector2 topLeft, Vector2 size)
        {
            SpritesCount = 1;
            TopLeft      = topLeft;
            Size         = size;
            String[] strTextures = new String[textureCount];
            for (int i = 0; i < textureCount; i++)
            {
                strTextures[i] = strPreTextures + (i + 1).ToString("00");
            }
            Texture2D[] textures = new Texture2D[textureCount];
            for (int i = 0; i < textureCount; i++)
            {
                textures[i] = content.Load <Texture2D>(strTextures[i]);
            }

            Sprites = new List <My2DSprite>();
            My2DSprite temp = new My2DSprite(textures, TopLeft);

            Sprites.Add(temp);
            SpritesCount = 1;
        }
Example #5
0
 public bool CheckCollision(My2DSprite sprite)
 {
     return(GetBound().Intersects(sprite.GetBound()));
 }