Ejemplo n.º 1
0
  MenuState(GameStateManager gsm) {
    super(gsm);

    try {
      bg = new Background("/Backgrounds/Menu.gif", 1);
      bg.setVector(-0.1, 0);

      titleColor = Color.WHITE;
      titleFont = new Font("Times New Roman", Font.PLAIN, 28);
      font = new Font("Times New Roman", Font.PLAIN, 12);

      music = new Audio("/Audio/mainTheme.wav");
      music.play();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Ejemplo n.º 2
0
  public void init() {

    walls = new ArrayList<Wall>();
    buttons = new ArrayList<Button>();

    tileMap = new TileMap(32);
    tileMap.loadMap("/Maps/Level" + gsm.getCurrentLevel() + ".map");
    System.out.println("/Maps/Level" + gsm.getCurrentLevel() + ".map");

    tileMap.loadTiles("/Tilesets/grasstileset.png");
    tileMap.setPosition(-0, 0);

    fadein = new FadeIn(tileMap, 20);
    fadein.setPosition(320, 240);
    fadeout = new FadeOut(tileMap, 20);
    fadeout.setPosition(320, 240);

    players = new ArrayList<MapObject>();

    if (gsm.getCurrentLevel() >= 3) {
      ji = new Ji(tileMap, true);
      players.add(ji);
      rae = new Rae(tileMap, true);
      players.add(rae);
    }
    populateDoors();
    setItUp();

    bg = new Background("/Backgrounds/cloudbg.png", 0.1);
    bg.setVector(-0.1, 0);
    tileMap.setPosition(0, 0);
    tileMap.setTween(1);

    startMusic();

    // JukeBox.load("Audio/CuriousCritters2.mp3", "level1");
    // JukeBox.loop("level1", 600, JukeBox.getFrames("level1") - 2200);
  }