@@ -0,0 +1,835 @@
+package com.betato.duckfall;%0A%0Aimport java.awt.image.BufferedImage;%0Aimport java.io.IOException;%0Aimport java.net.URL;%0Aimport java.util.HashMap;%0A%0Aimport javax.imageio.ImageIO;%0A%0Apublic class TextureLoader %7B%0A%0A%09private HashMap%3CString, BufferedImage%3E textures;%0A%09%0A%09public TextureLoader() %7B%0A%09%09textures = new HashMap%3C%3E();%0A%09%7D%0A%09%0A%09public BufferedImage getTexture(String name) %7B%0A%09%09if (!textures.containsKey(name)) %7B%0A%09%09%09textures.put(name, loadTexture(name));%0A%09%09%7D%0A%09%09return textures.get(name);%0A%09%7D%0A%0A%09private BufferedImage loadTexture(String name) %7B%0A%09%09URL path = this.getClass().getClassLoader().getResource(%22/resource/texture/%22 + name);%0A%09%09BufferedImage image = null;%0A%09%09try %7B%0A%09%09%09image = ImageIO.read(path);%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09System.out.println(%22IOException during loading %22 + name + %22: %22);%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%09return image;%0A%09%7D%0A%09%0A%7D%0A

Add TextureLoader class, which lazy loads images