@@ -0,0 +1,941 @@
+package jgame.impl;%0Aimport jgame.*;%0Apublic class ImageMap %7B%0A%09JGImage imageutil;%0A%09public JGImage img;%0A%09//public Image scaled_img=null;%0A%09public int xofs,yofs;%0A%09public int tilex,tiley;%0A%09public int skipx,skipy;%0A%09public ImageMap (JGImage imageutil,%0A%09String imgfile, int xofs,int yofs,%0A%09int tilex,int tiley, int skipx,int skipy) %7B%0A%09%09this.imageutil=imageutil;%0A%09%09img = imageutil.loadImage(imgfile);%0A%09%09this.xofs=xofs;%0A%09%09this.yofs=yofs;%0A%09%09this.tilex=tilex;%0A%09%09this.tiley=tiley;%0A%09%09this.skipx=skipx;%0A%09%09this.skipy=skipy;%0A%09%7D%0A%09//public int getHeight() %7B return img.getHeight(this); %7D%0A%09/** returns null when image was not loaded */%0A%09public JGPoint getImageCoord(int imgnr) %7B%0A%09%09if (img==null) return null;%0A%09%09JGPoint size = img.getSize();%0A%09%09int imgs_per_line = (size.x - xofs + skipx) / (tilex+skipx);%0A%09%09int ynr = imgnr / imgs_per_line;%0A%09%09int xnr = imgnr %25 imgs_per_line;%0A%09%09return new JGPoint(%0A%09%09%09xofs + xnr*(tilex+skipx),%0A%09%09%09yofs + ynr*(tiley+skipy) );%0A%09%7D%0A%7D%0A%0A

Create ImageMap.java