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; } }
// 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; }