コード例 #1
0
ファイル: World1State.java プロジェクト: NINJAMUSICIAN/Amodo
  public void draw(Graphics2D g) {

    bg.draw(g);

    tileMap.draw(g);

    for (int i = 0; i < pictures.size(); i++) {
      Images j = pictures.get(i);
      j.draw(g);
    }

    //		pinkDoor.Draw(g);
    //		greenDoor.Draw(g);
    for (int i = 0; i < buttons.size(); i++) {
      Button b = buttons.get(i);
      b.draw(g);
    }
    for (int i = 0; i < doors.size(); i++) {
      Door d = doors.get(i);
      d.Draw(g);
    }
    for (int i = 0; i < players.size(); i++) {
      MapObject m = players.get(i);
      m.draw(g);
    }

    for (int i = 0; i < walls.size(); i++) {
      walls.get(i).draw(g);
    }
    if (!fadein.isDone()) {
      fadein.draw(g);
    }
    fadeout.draw(g);
  }
コード例 #2
0
ファイル: World1State.java プロジェクト: NINJAMUSICIAN/Amodo
 public void checkColoredDoors() {
   if (pinkDoor.isSatisfied() && greenDoor.isSatisfied()) {
     fadeout.go();
     if (fadeout.isDone()) {
       players.clear();
       gsm.currentLevel = 4;
       gsm.setState(GameStateManager.LOADINGSTATE);
     }
   }
 }
コード例 #3
0
ファイル: World1State.java プロジェクト: NINJAMUSICIAN/Amodo
 public void checkRegularDoor10() {
   if (door10.isSatisfied()) {
     fadeout.go();
     if (fadeout.isDone()) {
       gsm.currentLevel = 11;
       doors.remove(door10);
       gsm.setState(GameStateManager.LOADINGSTATE);
     }
   }
 }
コード例 #4
0
ファイル: World1State.java プロジェクト: NINJAMUSICIAN/Amodo
  public void whatUpdate() {

    if (gsm.getCurrentLevel() == 1) {
      ji.update();
      door1.checkPlayers(ji, moved);
      checkRegularDoor1();
    }

    if (gsm.getCurrentLevel() == 2) {
      rae.update();
      door2.checkPlayers(rae, moved);
      checkRegularDoor2();
    }

    if (gsm.getCurrentLevel() == 3) {
      pinkDoor.checkRae(rae, moved);
      greenDoor.checkJi(ji, moved);
      checkColoredDoors();
    }

    if (gsm.getCurrentLevel() == 4) {
      door4.checkRae(rae, moved);
      checkRegularDoor4();
    }

    if (gsm.getCurrentLevel() == 5) {
      door5.checkPlayers(ji, rae, moved);
      checkRegularDoor5();
    }

    if (gsm.getCurrentLevel() == 6) {
      door6.checkPlayers(ji, rae, moved);
      checkRegularDoor6();
      ji.checkCatch(rae);
    }

    if (gsm.getCurrentLevel() == 7) {
      door7.checkPlayers(ji, rae, moved);
      checkRegularDoor7();
      ji.checkCatch(rae);
    }

    if (gsm.getCurrentLevel() == 8) {
      door8.checkPlayers(ji, rae, moved);
      checkRegularDoor8();
      ji.checkCatch(rae);
    }

    if (gsm.getCurrentLevel() == 9) {
      door9.checkPlayers(ji, rae, moved);
      checkRegularDoor9();
      ji.checkCatch(rae);
    }

    if (gsm.getCurrentLevel() == 10) {
      button.checkPress(ji);
      button.updateWall(ji);
      button.update();
      door10.checkPlayers(ji, rae, moved);
      checkRegularDoor10();
    }

    if (gsm.getCurrentLevel() >= 3) {
      ji.update();
      rae.update();
      ji.checkCatch(rae);
      if (ji.fellDead() || rae.fellDead()) {
        restart();
      }
    }
  }
コード例 #5
0
ファイル: World1State.java プロジェクト: NINJAMUSICIAN/Amodo
  public void populateDoors() {

    doors = new ArrayList<Door>();

    for (int i = 0; i < doors.size(); i++) {
      Door d = doors.get(i);
      doors.remove(d);
    }

    if (gsm.getCurrentLevel() == 1) {
      door1 = new Door(tileMap, "normal");
      door1.setPosition(580, 355);
      doors.add(door1);
    }

    if (gsm.getCurrentLevel() == 2) {
      door2 = new Door(tileMap, "normal");
      door2.setPosition(80, 325);
      doors.add(door2);
    }

    if (gsm.getCurrentLevel() == 3) {
      pinkDoor = new Door(tileMap, "pink");
      pinkDoor.setPosition(380, 322);
      doors.add(pinkDoor);
      greenDoor = new Door(tileMap, "green");
      greenDoor.setPosition(260, 355);
      doors.add(greenDoor);
    }

    if (gsm.getCurrentLevel() == 4) {
      door4 = new Door(tileMap, "normal");
      door4.setPosition(580, 291);
      doors.add(door4);
    }
    if (gsm.getCurrentLevel() == 5) {
      door5 = new Door(tileMap, "normal");
      door5.setPosition(92, 161);
      doors.add(door5);
      System.out.println(door5.isSatisfied());
    }

    if (gsm.getCurrentLevel() == 6) {
      door6 = new Door(tileMap, "normal");
      door6.setPosition(580, 418);
      doors.add(door6);
    }

    if (gsm.getCurrentLevel() == 7) {
      door7 = new Door(tileMap, "normal");
      door7.setPosition(285, 97);
      doors.add(door7);
    }

    if (gsm.getCurrentLevel() == 8) {
      door8 = new Door(tileMap, "normal");
      door8.setPosition(578, 417);
      doors.add(door8);
    }

    if (gsm.getCurrentLevel() == 9) {
      door9 = new Door(tileMap, "normal");
      door9.setPosition(305, 97);
      doors.add(door9);
    }

    if (gsm.getCurrentLevel() == 10) {
      door10 = new Door(tileMap, "normal");
      door10.setPosition(60, 162);
      doors.add(door10);
    }
  }