@@ -0,0 +1,1110 @@
+package com.drakeofthefells.graphics;%0A%0Apublic class Sprite %7B%0A%09%0A%09public final int SIZE;%0A%09private int x, y;%0A%09public int%5B%5D pixels;%0A%09private SpriteSheet sheet;%0A%09%0A%09public static Sprite grass = new Sprite(16, 0, 0, SpriteSheet.tiles);%0A%09%0A%09public static Sprite flower = new Sprite(16, 1, 0, SpriteSheet.tiles);%0A%09public static Sprite smallrock = new Sprite(16, 2, 0, SpriteSheet.tiles);%0A%09public static Sprite mushroomRed = new Sprite(16, 3, 0, SpriteSheet.tiles);%0A%09public static Sprite voidSprite = new Sprite(16, 0);%0A%09%0A%09public Sprite(int size, int x, int y, SpriteSheet sheet) %7B%0A%09%09SIZE = size;%0A%09%09pixels = new int%5BSIZE * SIZE%5D;%0A%09%09x = this.x * SIZE;%0A%09%09y = this.y * SIZE;%0A%09%09this.sheet = sheet;%0A%09%09load();%0A%09%7D%0A%09%0A%09public Sprite(int size, int color) %7B%0A%09%09SIZE = size;%0A%09%09pixels = new int%5BSIZE * SIZE%5D;%0A%09%09setColor(color);%0A%09%7D%0A%09%0A%09public void setColor(int color) %7B%0A%09%09for (int i = 0; i %3C SIZE * SIZE; i++) %7B%0A%09%09%09pixels%5Bi%5D = color;%0A%09%09%7D%0A%09%7D%0A%09%0A%09private void load() %7B%0A%09%09for (int y = 0; y %3C SIZE; y++) %7B%0A%09%09%09for (int x = 0; x %3C SIZE; x++) %7B%0A%09%09%09%09pixels%5Bx + y * SIZE%5D = sheet.pixels%5B(x + this.x) + (y + this.y) * sheet.SIZE%5D;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%0A%7D%0A

Create Sprite.java