Changeset b2d7893 in lost-haven
- Timestamp:
- Feb 20, 2021, 6:43:24 PM (4 years ago)
- Branches:
- master
- Children:
- 4d8825f
- Parents:
- a49176d
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/Creature.java
ra49176d rb2d7893 354 354 imgProj = LostHavenRPG.imgBow; 355 355 } 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")); 364 364 } 365 365 cr.model = cr.loadModel(cr.type.toString()); … … 391 391 BufferedImage walkE = null; 392 392 BufferedImage walkW = null; 393 boolean hasDeathAnim = (getClass().getResource(" ../images/" + folder + "/Death1.png") != null);393 boolean hasDeathAnim = (getClass().getResource("/images/" + folder + "/Death1.png") != null); 394 394 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")); 397 397 anmWalkN.addFrame(walkN); 398 walkS = ImageIO.read(getClass().getResource(" ../images/" + folder + "/WalkS.png"));398 walkS = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkS.png")); 399 399 anmWalkS.addFrame(walkS); 400 walkE = ImageIO.read(getClass().getResource(" ../images/" + folder + "/WalkE.png"));400 walkE = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkE.png")); 401 401 anmWalkE.addFrame(walkE); 402 walkW = ImageIO.read(getClass().getResource(" ../images/" + folder + "/WalkW.png"));402 walkW = ImageIO.read(getClass().getResource("/images/" + folder + "/WalkW.png")); 403 403 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")); 406 406 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")); 409 409 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")); 412 412 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")); 415 415 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"))); 417 417 } else { 418 418 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"))); 435 435 } 436 436 if (!noAnims) { 437 437 BufferedImage standN, standS, standE, standW; 438 if (getClass().getResource(" ../images/" + folder + "/StandN.png") == null) {438 if (getClass().getResource("/images/" + folder + "/StandN.png") == null) { 439 439 standN = walkN; 440 440 standS = walkS; … … 442 442 standW = walkW; 443 443 } 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")); 448 448 anmWalkN = new Animation("north", 0, 0, 40, 60, 150, true); 449 449 anmWalkS = new Animation("south", 0, 0, 40, 60, 150, true); … … 452 452 anmWalkN.addFrame(walkN); 453 453 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"))); 455 455 anmWalkN.addFrame(standN); 456 456 anmWalkS.addFrame(walkS); 457 457 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"))); 459 459 anmWalkS.addFrame(standS); 460 460 anmWalkE.addFrame(walkE); 461 461 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"))); 463 463 anmWalkE.addFrame(standE); 464 464 anmWalkW.addFrame(walkW); 465 465 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"))); 467 467 anmWalkW.addFrame(standW); 468 468 } … … 471 471 anmStandE.addFrame(standE); 472 472 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"))); 475 475 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"))); 477 477 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"))); 479 479 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"))); 481 481 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"))); 491 491 } else { 492 492 anmAttackN.addFrame(standN); … … 496 496 } 497 497 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"))); 500 500 } 501 501 } -
main/Item.java
ra49176d rb2d7893 19 19 this.loc = null; 20 20 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(); 24 25 } 25 26 } -
main/LostHavenRPG.java
ra49176d rb2d7893 122 122 this.auxState = AuxState.None; 123 123 loadMapElements(); 124 this.imgMap = ImageIO.read(getClass().getResource(" ../images/mapLarge.png"));124 this.imgMap = ImageIO.read(getClass().getResource("/images/mapLarge.png")); 125 125 map = new Map("map.png", "structInfo2.txt", landMap, structMap, true); 126 126 this.startPoint = new Point(7050, 6150); … … 165 165 Animation anmTitle = new Animation("title", 144, 0, 512, 95, 83, true); 166 166 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")); 176 176 } catch (IOException ioe) { 177 177 ioe.printStackTrace(); … … 322 322 for (int x = 0; x < this.wndTutorials.length; x++) { 323 323 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")))); 325 325 this.wndTutorials[x].add(this.wndTutOptions); 326 326 MultiTextbox multiTextbox = new MultiTextbox("text", 305, 5, 490, 100, "", false, font12, metrics); … … 432 432 try { 433 433 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")); 442 442 BufferedReader in = new BufferedReader(new FileReader("items.txt")); 443 443 while (in.ready()) { … … 487 487 waterSprites = loadSprites("water"); 488 488 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")); 493 493 } catch (IOException ioe) { 494 494 ioe.printStackTrace(); … … 499 499 BufferedImage[] sprites = new BufferedImage[8]; 500 500 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")); 509 509 } catch (IOException ioe) { 510 510 ioe.printStackTrace(); -
main/Map.java
ra49176d rb2d7893 19 19 if (readMapFromImage) { 20 20 try { 21 BufferedImage img = ImageIO.read(getClass().getResource(" ../images/" + mapFile));21 BufferedImage img = ImageIO.read(getClass().getResource("/images/" + mapFile)); 22 22 int length = img.getHeight(); 23 23 int height = img.getWidth(); … … 101 101 } else { 102 102 try { 103 BufferedReader in = new BufferedReader(new FileReader(" ../" + mapFile));103 BufferedReader in = new BufferedReader(new FileReader("/" + mapFile)); 104 104 String str = in.readLine(); 105 105 int length = Integer.parseInt(str.substring(0, str.indexOf("x"))); -
main/MapElement.java
ra49176d rb2d7893 18 18 public MapElement(String imgFile, boolean passable) { 19 19 try { 20 this.img = ImageIO.read(getClass().getResource(" ../images/" + imgFile));20 this.img = ImageIO.read(getClass().getResource("/images/" + imgFile)); 21 21 this.passable = passable; 22 } catch (IOException ioe) { 22 } catch (Exception ioe) { 23 System.out.println("Failed to load image " + imgFile); 23 24 ioe.printStackTrace(); 24 25 } -
makefile
ra49176d rb2d7893 1 # Copied from lost-perception 2 # TODO: Make this makefile work for this project 1 GAMEGUI_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 3 2 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 3 MAIN_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 9 4 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.class11 MAIN_ DEPS = main/LostHavenRPG.class5 GAMEGUI_INNER_DEPS = gamegui/Button\$$1.class gamegui/Label\$$1.class 6 MAIN_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 12 7 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 8 INNER_DEPS = $(GAMEGUI_INNER_DEPS) $(MAIN_INNER_DEPS) 16 9 17 #INNER_DEPS = $(GAMEGUI_INNER_DEPS) $(MAIN_INNER_DEPS) $(UTILS_INNER_DEPS) 10 IMAGE_FILE_DEPS = images/*.png images/*/*.png images/*/*/*.png 11 MAP_FIL_DEPS = 18 12 19 #DIALOG_FILE_DEPS = dialog/*.txt 20 #IMAGE_FILE_DEPS = images/*/*.png images/creatures/*/*/*.png images/*/*.ttf 21 #MAP_FILE_DEPS = maps/*.txt 13 CLASS_DEPS = $(MAIN_DEPS) $(GAMEGUI_DEPS) 14 FILE_DEPS = $(IMAGE_FILE_DEPS) $(MAP_FILE_DEPS) 22 15 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 $^ 16 LostHaven: $(CLASS_DEPS) $(FILE_DEPS) 17 jar cfe [email protected] main.LostHavenRPG $(INNER_DEPS) $^
Note:
See TracChangeset
for help on using the changeset viewer.