Exemplo n.º 1
0
        public Sprite(int width, int height, Coord origin, Spit defaultSpit)
        {
            // sets values
            this.origin = origin;
            this.width  = width;
            this.height = height;

            /// inializes spit array with blank spaces
            this.spitList = new Spit[width * (1 + height)];
            for (int i = 0; i < spitList.Length; i++)
            {
                spitList[i] = defaultSpit;
            }
        }
Exemplo n.º 2
0
 // sets the spit at the provided sprite index (start at top left)
 public void SetSpit(int spriteX, int spriteY, Spit spit)
 {
     spitList[(spriteY * width) + spriteX] = spit;
 }