Changeset b2d7893 in lost-haven for main/MapElement.java


Ignore:
Timestamp:
Feb 20, 2021, 6:43:24 PM (4 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
master
Children:
4d8825f
Parents:
a49176d
Message:

Change all file paths to work from inside a JAR and update the makefile to correctly build the project

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/MapElement.java

    ra49176d rb2d7893  
    1818  public MapElement(String imgFile, boolean passable) {
    1919    try {
    20       this.img = ImageIO.read(getClass().getResource("../images/" + imgFile));
     20      this.img = ImageIO.read(getClass().getResource("/images/" + imgFile));
    2121      this.passable = passable;
    22     } catch (IOException ioe) {
     22    } catch (Exception ioe) {
     23      System.out.println("Failed to load image " + imgFile);
    2324      ioe.printStackTrace();
    2425    }
Note: See TracChangeset for help on using the changeset viewer.