@@ -0,0 +1,1291 @@
+package eco.game;%0A%0Aimport org.newdawn.slick.opengl.Texture;%0A%0A/**%0A * This class makes is easier to use a texture atlas. It contains methods that%0A * return a float position of where a subtexture is located. Has adjustable%0A * resolution and size%0A * %0A * @author phil%0A * %0A */%0A%0Apublic class TextureAtlas %7B%0A%0A%09private Texture texture;%0A%0A%09private int textureRes = 8;%0A%09private int size = 8;%0A%0A%09public TextureAtlas(Texture texture) %7B%0A%09%09this.texture = texture;%0A%09%7D%0A%0A%09public TextureAtlas(Texture texture, int size, int resolution) %7B%0A%09%09this.texture = texture;%0A%09%09this.size = size;%0A%09%09this.textureRes = resolution;%0A%09%7D%0A%0A%09public float getXCoord(int pos, boolean increase) %7B%0A%09%09int pixelPos = pos * textureRes;%0A%09%09if (increase) %7B%0A%09%09%09pixelPos += textureRes;%0A%09%09%7D%0A%09%09return (float) pixelPos / (float) (textureRes * size);%0A%09%7D%0A%0A%09public float getYCoord(int pos, boolean increase) %7B%0A%09%09int pixelPos = pos * textureRes;%0A%09%09if (increase) %7B%0A%09%09%09pixelPos += textureRes;%0A%09%09%7D%0A%09%09return (float) pixelPos / (float) (textureRes * size);%0A%09%7D%0A%0A%09public float getCoord(int pos, boolean increase) %7B%0A%09%09int pixelPos = pos * textureRes;%0A%09%09if (increase) %7B%0A%09%09%09pixelPos += textureRes;%0A%09%09%7D%0A%09%09return (float) pixelPos / (float) (textureRes * size);%0A%09%7D%0A%0A%09public Texture getTexture() %7B%0A%09%09return texture;%0A%09%7D%0A%0A%09public void bind() %7B%0A%09%09texture.bind();%0A%09%7D%0A%0A%7D%0A

Create TextureAtlas.java