Changeset b2d7893 in lost-haven


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

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/Creature.java

    ra49176d rb2d7893  
    354354        imgProj = LostHavenRPG.imgBow;
    355355      } else if (wType == ItemType.Spell) {
    356         imgProj[0] = ImageIO.read(cr.getClass().getResource("../images/" + cr.type.toString() + "/proj.png"));
    357         imgProj[1] = ImageIO.read(cr.getClass().getResource("../images/" + cr.type.toString() + "/proj.png"));
    358         imgProj[2] = ImageIO.read(cr.getClass().getResource("../images/" + cr.type.toString() + "/proj.png"));
    359         imgProj[3] = ImageIO.read(cr.getClass().getResource("../images/" + cr.type.toString() + "/proj.png"));
    360         imgProj[4] = ImageIO.read(cr.getClass().getResource("../images/" + cr.type.toString() + "/proj.png"));
    361         imgProj[5] = ImageIO.read(cr.getClass().getResource("../images/" + cr.type.toString() + "/proj.png"));
    362         imgProj[6] = ImageIO.read(cr.getClass().getResource("../images/" + cr.type.toString() + "/proj.png"));
    363         imgProj[7] = ImageIO.read(cr.getClass().getResource("../images/" + cr.type.toString() + "/proj.png"));
     356        imgProj[0] = ImageIO.read(cr.getClass().getResource("/images/" + cr.type.toString() + "/proj.png"));
     357        imgProj[1] = ImageIO.read(cr.getClass().getResource("/images/" + cr.type.toString() + "/proj.png"));
     358        imgProj[2] = ImageIO.read(cr.getClass().getResource("/images/" + cr.type.toString() + "/proj.png"));
     359        imgProj[3] = ImageIO.read(cr.getClass().getResource("/images/" + cr.type.toString() + "/proj.png"));
     360        imgProj[4] = ImageIO.read(cr.getClass().getResource("/images/" + cr.type.toString() + "/proj.png"));
     361        imgProj[5] = ImageIO.read(cr.getClass().getResource("/images/" + cr.type.toString() + "/proj.png"));
     362        imgProj[6] = ImageIO.read(cr.getClass().getResource("/images/" + cr.type.toString() + "/proj.png"));
     363        imgProj[7] = ImageIO.read(cr.getClass().getResource("/images/" + cr.type.toString() + "/proj.png"));
    364364      }
    365365      cr.model = cr.loadModel(cr.type.toString());
     
    391391    BufferedImage walkE = null;
    392392    BufferedImage walkW = null;
    393     boolean hasDeathAnim = (getClass().getResource("../images/" + folder + "/Death1.png") != null);
     393    boolean hasDeathAnim = (getClass().getResource("/images/" + folder + "/Death1.png") != null);
    394394    try {
    395       if (getClass().getResource("../images/" + folder + "/WalkN.png") != null) {
    396         walkN = ImageIO.read(getClass().getResource("../images/" + folder + "/WalkN.png"));
     395      if (getClass().getResource("/images/" + folder + "/WalkN.png") != null) {
     396        walkN = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkN.png"));
    397397        anmWalkN.addFrame(walkN);
    398         walkS = ImageIO.read(getClass().getResource("../images/" + folder + "/WalkS.png"));
     398        walkS = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkS.png"));
    399399        anmWalkS.addFrame(walkS);
    400         walkE = ImageIO.read(getClass().getResource("../images/" + folder + "/WalkE.png"));
     400        walkE = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkE.png"));
    401401        anmWalkE.addFrame(walkE);
    402         walkW = ImageIO.read(getClass().getResource("../images/" + folder + "/WalkW.png"));
     402        walkW = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkW.png"));
    403403        anmWalkW.addFrame(walkW);
    404       } else if (getClass().getResource("../images/" + folder + "/WalkN1.png") != null) {
    405         walkN = ImageIO.read(getClass().getResource("../images/" + folder + "/WalkN1.png"));
     404      } else if (getClass().getResource("/images/" + folder + "/WalkN1.png") != null) {
     405        walkN = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkN1.png"));
    406406        anmWalkN.addFrame(walkN);
    407         anmWalkN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/WalkN2.png")));
    408         walkS = ImageIO.read(getClass().getResource("../images/" + folder + "/WalkS1.png"));
     407        anmWalkN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/WalkN2.png")));
     408        walkS = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkS1.png"));
    409409        anmWalkS.addFrame(walkS);
    410         anmWalkS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/WalkS2.png")));
    411         walkE = ImageIO.read(getClass().getResource("../images/" + folder + "/WalkE1.png"));
     410        anmWalkS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/WalkS2.png")));
     411        walkE = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkE1.png"));
    412412        anmWalkE.addFrame(walkE);
    413         anmWalkE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/WalkE2.png")));
    414         walkW = ImageIO.read(getClass().getResource("../images/" + folder + "/WalkW1.png"));
     413        anmWalkE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/WalkE2.png")));
     414        walkW = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkW1.png"));
    415415        anmWalkW.addFrame(walkW);
    416         anmWalkW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/WalkW2.png")));
     416        anmWalkW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/WalkW2.png")));
    417417      } else {
    418418        noAnims = true;
    419         anmStandN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    420         anmStandS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    421         anmStandE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    422         anmStandW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    423         anmWalkN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    424         anmWalkN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    425         anmWalkS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    426         anmWalkS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    427         anmWalkE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    428         anmWalkE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    429         anmWalkW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    430         anmWalkW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    431         anmAttackN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    432         anmAttackS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    433         anmAttackE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
    434         anmAttackW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/" + folder + ".png")));
     419        anmStandN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     420        anmStandS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     421        anmStandE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     422        anmStandW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     423        anmWalkN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     424        anmWalkN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     425        anmWalkS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     426        anmWalkS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     427        anmWalkE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     428        anmWalkE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     429        anmWalkW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     430        anmWalkW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     431        anmAttackN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     432        anmAttackS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     433        anmAttackE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
     434        anmAttackW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/" + folder + ".png")));
    435435      }
    436436      if (!noAnims) {
    437437        BufferedImage standN, standS, standE, standW;
    438         if (getClass().getResource("../images/" + folder + "/StandN.png") == null) {
     438        if (getClass().getResource("/images/" + folder + "/StandN.png") == null) {
    439439          standN = walkN;
    440440          standS = walkS;
     
    442442          standW = walkW;
    443443        } else {
    444           standN = ImageIO.read(getClass().getResource("../images/" + folder + "/StandN.png"));
    445           standS = ImageIO.read(getClass().getResource("../images/" + folder + "/StandS.png"));
    446           standE = ImageIO.read(getClass().getResource("../images/" + folder + "/StandE.png"));
    447           standW = ImageIO.read(getClass().getResource("../images/" + folder + "/StandW.png"));
     444          standN = ImageIO.read(getClass().getResource("/images/" + folder + "/StandN.png"));
     445          standS = ImageIO.read(getClass().getResource("/images/" + folder + "/StandS.png"));
     446          standE = ImageIO.read(getClass().getResource("/images/" + folder + "/StandE.png"));
     447          standW = ImageIO.read(getClass().getResource("/images/" + folder + "/StandW.png"));
    448448          anmWalkN = new Animation("north", 0, 0, 40, 60, 150, true);
    449449          anmWalkS = new Animation("south", 0, 0, 40, 60, 150, true);
     
    452452          anmWalkN.addFrame(walkN);
    453453          anmWalkN.addFrame(standN);
    454           anmWalkN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/WalkN2.png")));
     454          anmWalkN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/WalkN2.png")));
    455455          anmWalkN.addFrame(standN);
    456456          anmWalkS.addFrame(walkS);
    457457          anmWalkS.addFrame(standS);
    458           anmWalkS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/WalkS2.png")));
     458          anmWalkS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/WalkS2.png")));
    459459          anmWalkS.addFrame(standS);
    460460          anmWalkE.addFrame(walkE);
    461461          anmWalkE.addFrame(standE);
    462           anmWalkE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/WalkE2.png")));
     462          anmWalkE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/WalkE2.png")));
    463463          anmWalkE.addFrame(standE);
    464464          anmWalkW.addFrame(walkW);
    465465          anmWalkW.addFrame(standW);
    466           anmWalkW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/WalkW2.png")));
     466          anmWalkW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/WalkW2.png")));
    467467          anmWalkW.addFrame(standW);
    468468        }
     
    471471        anmStandE.addFrame(standE);
    472472        anmStandW.addFrame(standW);
    473         if (getClass().getResource("../images/" + folder + "/AttackN.png") != null) {
    474           anmAttackN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackN.png")));
     473        if (getClass().getResource("/images/" + folder + "/AttackN.png") != null) {
     474          anmAttackN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackN.png")));
    475475          anmAttackN.addFrame(standN);
    476           anmAttackS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackS.png")));
     476          anmAttackS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackS.png")));
    477477          anmAttackS.addFrame(standS);
    478           anmAttackE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackE.png")));
     478          anmAttackE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackE.png")));
    479479          anmAttackE.addFrame(standE);
    480           anmAttackW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackW.png")));
     480          anmAttackW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackW.png")));
    481481          anmAttackW.addFrame(standW);
    482         } else if (getClass().getResource("../images/" + folder + "/AttackN1.png") != null) {
    483           anmAttackN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackN1.png")));
    484           anmAttackN.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackN2.png")));
    485           anmAttackS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackS1.png")));
    486           anmAttackS.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackS2.png")));
    487           anmAttackE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackE1.png")));
    488           anmAttackE.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackE2.png")));
    489           anmAttackW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackW1.png")));
    490           anmAttackW.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/AttackW2.png")));
     482        } else if (getClass().getResource("/images/" + folder + "/AttackN1.png") != null) {
     483          anmAttackN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackN1.png")));
     484          anmAttackN.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackN2.png")));
     485          anmAttackS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackS1.png")));
     486          anmAttackS.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackS2.png")));
     487          anmAttackE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackE1.png")));
     488          anmAttackE.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackE2.png")));
     489          anmAttackW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackW1.png")));
     490          anmAttackW.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/AttackW2.png")));
    491491        } else {
    492492          anmAttackN.addFrame(standN);
     
    496496        }
    497497        if (hasDeathAnim) {
    498           anmDeath.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/Death1.png")));
    499           anmDeath.addFrame(ImageIO.read(getClass().getResource("../images/" + folder + "/Death2.png")));
     498          anmDeath.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/Death1.png")));
     499          anmDeath.addFrame(ImageIO.read(getClass().getResource("/images/" + folder + "/Death2.png")));
    500500        }
    501501      }
  • main/Item.java

    ra49176d rb2d7893  
    1919    this.loc = null;
    2020    try {
    21       this.img = ImageIO.read(getClass().getResource("../images/" + strImg));
    22     } catch (IOException ioe) {
    23       ioe.printStackTrace();
     21      this.img = ImageIO.read(getClass().getResource("/images/" + strImg));
     22    } catch (IOException | IllegalArgumentException e) {
     23      System.out.println("Failed to load image: /images/" + strImg);
     24      e.printStackTrace();
    2425    }
    2526  }
  • main/LostHavenRPG.java

    ra49176d rb2d7893  
    122122      this.auxState = AuxState.None;
    123123      loadMapElements();
    124       this.imgMap = ImageIO.read(getClass().getResource("../images/mapLarge.png"));
     124      this.imgMap = ImageIO.read(getClass().getResource("/images/mapLarge.png"));
    125125      map = new Map("map.png", "structInfo2.txt", landMap, structMap, true);
    126126      this.startPoint = new Point(7050, 6150);
     
    165165    Animation anmTitle = new Animation("title", 144, 0, 512, 95, 83, true);
    166166    try {
    167       anmTitle.addFrame(ImageIO.read(getClass().getResource("../images/Frame1.png")));
    168       anmTitle.addFrame(ImageIO.read(getClass().getResource("../images/Frame2.png")));
    169       anmTitle.addFrame(ImageIO.read(getClass().getResource("../images/Frame3.png")));
    170       anmTitle.addFrame(ImageIO.read(getClass().getResource("../images/Frame4.png")));
    171       anmTitle.addFrame(ImageIO.read(getClass().getResource("../images/Frame5.png")));
    172       imgSub = ImageIO.read(getClass().getResource("../images/imgSub.png"));
    173       imgAdd = ImageIO.read(getClass().getResource("../images/imgAdd.png"));
    174       imgSkillSub = ImageIO.read(getClass().getResource("../images/imgSkillSub.png"));
    175       imgSkillAdd = ImageIO.read(getClass().getResource("../images/imgSkillAdd.png"));
     167      anmTitle.addFrame(ImageIO.read(getClass().getResource("/images/Frame1.png")));
     168      anmTitle.addFrame(ImageIO.read(getClass().getResource("/images/Frame2.png")));
     169      anmTitle.addFrame(ImageIO.read(getClass().getResource("/images/Frame3.png")));
     170      anmTitle.addFrame(ImageIO.read(getClass().getResource("/images/Frame4.png")));
     171      anmTitle.addFrame(ImageIO.read(getClass().getResource("/images/Frame5.png")));
     172      imgSub = ImageIO.read(getClass().getResource("/images/imgSub.png"));
     173      imgAdd = ImageIO.read(getClass().getResource("/images/imgAdd.png"));
     174      imgSkillSub = ImageIO.read(getClass().getResource("/images/imgSkillSub.png"));
     175      imgSkillAdd = ImageIO.read(getClass().getResource("/images/imgSkillAdd.png"));
    176176    } catch (IOException ioe) {
    177177      ioe.printStackTrace();
     
    322322      for (int x = 0; x < this.wndTutorials.length; x++) {
    323323        this.wndTutorials[x] = new Window("tut" + x, 0, 0, 800, 600, true);
    324         this.wndTutorials[x].add(new Button("screen", 0, 0, 800, 600, ImageIO.read(getClass().getResource("../images/Tutorial/ss" + (x + 1) + ".png"))));
     324        this.wndTutorials[x].add(new Button("screen", 0, 0, 800, 600, ImageIO.read(getClass().getResource("/images/Tutorial/ss" + (x + 1) + ".png"))));
    325325        this.wndTutorials[x].add(this.wndTutOptions);
    326326        MultiTextbox multiTextbox = new MultiTextbox("text", 305, 5, 490, 100, "", false, font12, metrics);
     
    432432    try {
    433433      imgBow = new BufferedImage[8];
    434       imgBow[0] = ImageIO.read(getClass().getResource("../images/projectiles/bowNN.png"));
    435       imgBow[1] = ImageIO.read(getClass().getResource("../images/projectiles/bowNE.png"));
    436       imgBow[2] = ImageIO.read(getClass().getResource("../images/projectiles/bowEE.png"));
    437       imgBow[3] = ImageIO.read(getClass().getResource("../images/projectiles/bowSE.png"));
    438       imgBow[4] = ImageIO.read(getClass().getResource("../images/projectiles/bowSS.png"));
    439       imgBow[5] = ImageIO.read(getClass().getResource("../images/projectiles/bowSW.png"));
    440       imgBow[6] = ImageIO.read(getClass().getResource("../images/projectiles/bowWW.png"));
    441       imgBow[7] = ImageIO.read(getClass().getResource("../images/projectiles/bowNW.png"));
     434      imgBow[0] = ImageIO.read(getClass().getResource("/images/projectiles/bowNN.png"));
     435      imgBow[1] = ImageIO.read(getClass().getResource("/images/projectiles/bowNE.png"));
     436      imgBow[2] = ImageIO.read(getClass().getResource("/images/projectiles/bowEE.png"));
     437      imgBow[3] = ImageIO.read(getClass().getResource("/images/projectiles/bowSE.png"));
     438      imgBow[4] = ImageIO.read(getClass().getResource("/images/projectiles/bowSS.png"));
     439      imgBow[5] = ImageIO.read(getClass().getResource("/images/projectiles/bowSW.png"));
     440      imgBow[6] = ImageIO.read(getClass().getResource("/images/projectiles/bowWW.png"));
     441      imgBow[7] = ImageIO.read(getClass().getResource("/images/projectiles/bowNW.png"));
    442442      BufferedReader in = new BufferedReader(new FileReader("items.txt"));
    443443      while (in.ready()) {
     
    487487    waterSprites = loadSprites("water");
    488488    try {
    489       passiveAura = ImageIO.read(getClass().getResource("../images/spells/auras/passiveAura.png"));
    490       thornsAura = ImageIO.read(getClass().getResource("../images/spells/auras/thornsAura.png"));
    491       confuseAura = ImageIO.read(getClass().getResource("../images/spells/auras/confuseAura.png"));
    492       sandAura = ImageIO.read(getClass().getResource("../images/spells/auras/sandAura.png"));
     489      passiveAura = ImageIO.read(getClass().getResource("/images/spells/auras/passiveAura.png"));
     490      thornsAura = ImageIO.read(getClass().getResource("/images/spells/auras/thornsAura.png"));
     491      confuseAura = ImageIO.read(getClass().getResource("/images/spells/auras/confuseAura.png"));
     492      sandAura = ImageIO.read(getClass().getResource("/images/spells/auras/sandAura.png"));
    493493    } catch (IOException ioe) {
    494494      ioe.printStackTrace();
     
    499499    BufferedImage[] sprites = new BufferedImage[8];
    500500    try {
    501       sprites[0] = ImageIO.read(getClass().getResource("../images/spells/" + name + "/" + name + "SpellNN.png"));
    502       sprites[1] = ImageIO.read(getClass().getResource("../images/spells/" + name + "/" + name + "SpellNE.png"));
    503       sprites[2] = ImageIO.read(getClass().getResource("../images/spells/" + name + "/" + name + "SpellEE.png"));
    504       sprites[3] = ImageIO.read(getClass().getResource("../images/spells/" + name + "/" + name + "SpellSE.png"));
    505       sprites[4] = ImageIO.read(getClass().getResource("../images/spells/" + name + "/" + name + "SpellSS.png"));
    506       sprites[5] = ImageIO.read(getClass().getResource("../images/spells/" + name + "/" + name + "SpellSW.png"));
    507       sprites[6] = ImageIO.read(getClass().getResource("../images/spells/" + name + "/" + name + "SpellWW.png"));
    508       sprites[7] = ImageIO.read(getClass().getResource("../images/spells/" + name + "/" + name + "SpellNW.png"));
     501      sprites[0] = ImageIO.read(getClass().getResource("/images/spells/" + name + "/" + name + "SpellNN.png"));
     502      sprites[1] = ImageIO.read(getClass().getResource("/images/spells/" + name + "/" + name + "SpellNE.png"));
     503      sprites[2] = ImageIO.read(getClass().getResource("/images/spells/" + name + "/" + name + "SpellEE.png"));
     504      sprites[3] = ImageIO.read(getClass().getResource("/images/spells/" + name + "/" + name + "SpellSE.png"));
     505      sprites[4] = ImageIO.read(getClass().getResource("/images/spells/" + name + "/" + name + "SpellSS.png"));
     506      sprites[5] = ImageIO.read(getClass().getResource("/images/spells/" + name + "/" + name + "SpellSW.png"));
     507      sprites[6] = ImageIO.read(getClass().getResource("/images/spells/" + name + "/" + name + "SpellWW.png"));
     508      sprites[7] = ImageIO.read(getClass().getResource("/images/spells/" + name + "/" + name + "SpellNW.png"));
    509509    } catch (IOException ioe) {
    510510      ioe.printStackTrace();
  • main/Map.java

    ra49176d rb2d7893  
    1919    if (readMapFromImage) {
    2020      try {
    21         BufferedImage img = ImageIO.read(getClass().getResource("../images/" + mapFile));
     21        BufferedImage img = ImageIO.read(getClass().getResource("/images/" + mapFile));
    2222        int length = img.getHeight();
    2323        int height = img.getWidth();
     
    101101    } else {
    102102      try {
    103         BufferedReader in = new BufferedReader(new FileReader("../" + mapFile));
     103        BufferedReader in = new BufferedReader(new FileReader("/" + mapFile));
    104104        String str = in.readLine();
    105105        int length = Integer.parseInt(str.substring(0, str.indexOf("x")));
  • 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    }
  • makefile

    ra49176d rb2d7893  
    1 # Copied from lost-perception
    2 # TODO: Make this makefile work for this project
     1GAMEGUI_DEPS = gamegui/Align.class gamegui/Animation.class gamegui/Button.class gamegui/Label.class gamegui/Listable.class gamegui/Member.class gamegui/MultiTextbox.class gamegui/ScrollBar.class gamegui/ScrollList.class gamegui/Textbox.class gamegui/Window.class
    32
    4 #ASTAR_DEPS = astar/AStarMap.class astar/AStarNode.class astar/AStarSearch.class astar/BinaryHeap.class astar/QuadTree.class
    5 #COLLISION_DEPS = collision/Bound.class
    6 #GAMEGUI_DEPS = gamegui/Align.class gamegui/Animation.class gamegui/Button.class gamegui/Label.class gamegui/Listable.class gamegui/Member.class gamegui/ScrollBar.class gamegui/ScrollList.class gamegui/Textbox.class gamegui/Window.class
    7 GAMEGUI_DEPS = gamegui/Animation.class gamegui/Button.class gamegui/Label.class gamegui/Member.class gamegui/RadioGroup.class gamegui/Textbox.class
    8 #UTILS_DEPS = utils/DynamicImage.class utils/Utils.class utils/WrappedString.class
     3MAIN_DEPS = main/Action.class main/AreaOfEffect.class main/ArtifactPoint.class main/AttackType.class main/Attribute.class main/AuxState.class main/ChangeDamage.class main/Confuse.class main/Creature.class main/CreatureType.class main/Damage.class main/Direction.class main/Disable.class main/GameState.class main/Effect.class main/EffectType.class main/EquippedWeapon.class main/Gem.class main/Item.class main/ItemDrop.class main/ItemType.class main/Land.class main/LandType.class main/Location.class main/LostHavenRPG.class main/ManaDrain.class main/Map.class main/MapElement.class main/Model.class main/MoveSpeed.class main/Penetrate.class main/Player.class main/Point.class main/ProjectileSpeed.class main/RespawnPoint.class main/Skill.class main/SpawnPoint.class main/Structure.class main/StructureType.class main/TargetType.class main/TimedEffect.class main/Weapon.class
    94
    10 #MAIN_DEPS = main/Action.class main/Armor.class main/Creature.class main/Dialog.class main/Direction.class main/Effect.class main/Enemy.class main/Item.class main/Location.class main/LostHavenRPG.class main/Map.class main/MapImage.class main/MapObject.class main/MapType.class main/Model.class main/NPC.class main/Player.class main/StatType.class main/Tile.class main/Weapon.class
    11 MAIN_DEPS = main/LostHavenRPG.class
     5GAMEGUI_INNER_DEPS = gamegui/Button\$$1.class gamegui/Label\$$1.class
     6MAIN_INNER_DEPS = main/Creature\$$1.class main/EquippedWeapon\$$1.class main/LostHavenRPG\$$1.class main/Model\$$1.class main/Player\$$1.class main/Player\$$ItemImg.class
    127
    13 #GAMEGUI_INNER_DEPS = gamegui/Button\$$1.class gamegui/Label\$$1.class
    14 #MAIN_INNER_DEPS = main/Armor\$$ArmorType.class main/Effect\$$MoveSpeed.class main/Effect\$$Hitpoints.class main/Effect\$$Manapoints.class main/Effect\$$Damage.class main/Effect\$$AttackSpeed.class main/LostHavenRPG\$$1.class main/LostHavenRPG\$$AuxState.class main/LostHavenRPG\$$GameState.class main/Model\$$1.class
    15 #UTILS_INNER_DEPS = utils/Utils\$$1.class
     8INNER_DEPS = $(GAMEGUI_INNER_DEPS) $(MAIN_INNER_DEPS)
    169
    17 #INNER_DEPS = $(GAMEGUI_INNER_DEPS) $(MAIN_INNER_DEPS) $(UTILS_INNER_DEPS)
     10IMAGE_FILE_DEPS = images/*.png images/*/*.png images/*/*/*.png
     11MAP_FIL_DEPS =
    1812
    19 #DIALOG_FILE_DEPS = dialog/*.txt
    20 #IMAGE_FILE_DEPS = images/*/*.png images/creatures/*/*/*.png images/*/*.ttf
    21 #MAP_FILE_DEPS = maps/*.txt
     13CLASS_DEPS = $(MAIN_DEPS) $(GAMEGUI_DEPS)
     14FILE_DEPS = $(IMAGE_FILE_DEPS) $(MAP_FILE_DEPS)
    2215
    23 #CLASS_DEPS = $(MAIN_DEPS) $(ASTAR_DEPS) $(GAMEGUI_DEPS) $(COLLISION_DEPS) $(UTILS_DEPS)
    24 CLASS_DEPS = $(MAIN_DEPS)
    25 #FILE_DEPS = $(DIALOG_FILE_DEPS) $(IMAGE_FILE_DEPS) $(MAP_FILE_DEPS)
    26 FILE_DEPS =
    27 
    28 LostHaven: $(CLASS_DEPS) #$(FILE_DEPS)
    29         jar cfe [email protected] main.LostHavenRPG $^
     16LostHaven: $(CLASS_DEPS) $(FILE_DEPS)
     17        jar cfe [email protected] main.LostHavenRPG $(INNER_DEPS) $^
Note: See TracChangeset for help on using the changeset viewer.