Esempio n. 1
0
  public void update() {

    handleInput();
    if (!fadein.isDone()) {
      fadein.update();
    }
    if (!fadeout.isDone()) {
      fadeout.update();
    }
    if (gsm.getCurrentLevel() == 4) {
      ji.checkCatch(rae);
    }

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

    whatUpdate();
    bg.update();

    for (int i = 0; i < walls.size(); i++) {
      Wall w = walls.get(i);
      if (!w.removed()) {
        w.checkCollision(ji);
        w.checkCollision(rae);
      }
      if (w.shouldRemove()) {
        walls.remove(wall);
        i--;
      }
    }

    // wall.checkCollision(ji);
  }
Esempio n. 2
0
  public void setItUp() {

    pictures = new ArrayList<Images>();

    if (gsm.getCurrentLevel() == 1) {
      ji = new Ji(tileMap, true);
      ji.setPosition(80, 400);
      players.add(ji);
      image = new Images(tileMap, "/Backgrounds/Texts/LevelOne.png");
      image.setPosition(320, 240);
      pictures.add(image);
      image = new Images(tileMap, "/Maps/Other/LevelOne.png");
      image.setPosition(320, 240);
      pictures.add(image);
    }

    if (gsm.getCurrentLevel() == 2) {
      rae = new Rae(tileMap, true);
      rae.setPosition(580, 400);
      players.add(rae);
      image = new Images(tileMap, "/Backgrounds/Texts/LevelTwo.png");
      image.setPosition(320, 240);
      pictures.add(image);
    }

    if (gsm.getCurrentLevel() == 3) {
      ji.setPosition(80, 400);
      rae.setPosition(580, 400);
      image = new Images(tileMap, "/Backgrounds/Texts/LevelThree.png");
      image.setPosition(320, 240);
      pictures.add(image);
      image = new Images(tileMap, "/Maps/Other/LevelThree.png");
      image.setPosition(320, 240);
      pictures.add(image);
    }

    if (gsm.getCurrentLevel() == 4) {
      ji.setPosition(80, 400);
      rae.setPosition(160, 400);
      image = new Images(tileMap, "/Backgrounds/Texts/LevelFour.png");
      image.setPosition(320, 240);
      pictures.add(image);
    }

    if (gsm.getCurrentLevel() == 5) {
      ji.setPosition(80, 400);
      rae.setPosition(160, 400);
    }

    if (gsm.getCurrentLevel() == 6) {
      ji.setPosition(50, 400);
      rae.setPosition(80, 400);
      image = new Images(tileMap, "/Backgrounds/Texts/LevelSix.png");
      image.setPosition(320, 240);
      pictures.add(image);
    }

    if (gsm.getCurrentLevel() == 7) {
      ji.setPosition(300, 400);
      rae.setPosition(340, 400);
    }

    if (gsm.getCurrentLevel() == 8) {
      ji.setPosition(240, 415);
      rae.setPosition(60, 160);
      setActivePlayer(1);
      image = new Images(tileMap, "/Backgrounds/Texts/LevelEight.png");
      image.setPosition(320, 240);
      pictures.add(image);
    }

    if (gsm.getCurrentLevel() == 9) {
      ji.setPosition(260, 250);
      rae.setPosition(240, 415);
      image = new Images(tileMap, "/Maps/Other/LevelEleven.png");
      image.setPosition(320, 431);
      pictures.add(image);
    }

    if (gsm.getCurrentLevel() == 10) {
      ji.setPosition(350, 415); // 350 415
      rae.setPosition(350, 100);
      setActivePlayer(0);
      wall = new Wall(3, "vert", "anything", tileMap);
      wall.setPosition(144, 144);
      walls.add(wall);
      button = new Button(tileMap, "left", "break", wall);
      button.setPosition(592, 432);
      buttons.add(button);
      image = new Images(tileMap, "/Backgrounds/Texts/LevelTen.png");
      image.setPosition(320, 240);
      pictures.add(image);
    }
  }
Esempio n. 3
0
  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();
      }
    }
  }