Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // LD22.java
- // inserted into main
- System.setProperty("org.lwjgl.librarypath",
- new File(new File(System.getProperty("user.dir"), "native"),
- LWJGLUtil.getPlatformName()).getAbsolutePath());
- System.setProperty("net.java.games.input.librarypath",
- System.getProperty("org.lwjgl.librarypath"));
- AppGameContainer app = null;
- try {
- app = new AppGameContainer(new LD22Warmup());
- app.setDisplayMode(800, 600, false);
- app.setTargetFrameRate(60);
- app.setShowFPS(true);
- app.start();
- } catch (SlickException ex) {
- System.exit(1);
- }
- // Game.java
- // + versions for Music and Sound
- public static Image image(String file) {
- String path = basepath + "/graphics/";
- try {
- return new Image(path + file + ".png");
- } catch (Exception ex) {
- System.err.println("ERROR: Failed to open image '" + file + "'");
- // avoid endless recursion
- if (!file.equals("missing")) {
- return image("missing");
- }
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment