예제 #1
0
  public void render() {
    BufferStrategy bs = getBufferStrategy();

    if (bs == null) {
      createBufferStrategy(3);
      return;
    }

    screen.clear();

    int xScroll = player.getX() - screen.width / 2;
    int yScroll = player.getY() - screen.height / 2;
    level.render(xScroll, yScroll, screen);

    for (int i = 0; i < pixels.length; i++) {

      pixels[i] = screen.pixels[i];
    }

    Graphics g = bs.getDrawGraphics();

    if (ea.State == ea.State.MENU) {
      menuu.renderMenu(g);
    } else if (ea.State == ea.State.CONVERSAINICIAL) {
      falas.renderFala(g);
    } else if (ea.State == ea.State.CREDITS) {
      menuu.renderCredits(g);
    } else if (ea.State == ea.State.GAME) {
      g.drawImage(image, 0, 0, getWidth(), getHeight(), null);
      digni.render(g);
    } else if (ea.State == ea.State.CONVERSAORC) {
      falas.renderFala(g);
    }

    g.dispose();
    bs.show();
  }
예제 #2
0
 public void render(Graphics g) {
   level.render(selected, screenX, screenY, g);
   GUI.render(input, screenX, screenY, g);
 }