@Override
  public void displayOutput(AsciiPanel terminal) {
    int x = terminal.getWidthInCharacters() / 4;
    int y = terminal.getHeightInCharacters() / 4;
    int x2 = (x * 3) - 1;
    int y2 = y * 3;

    GameEngine.clearArea(x, y, x2, y2);

    this.menu.displayOutput(terminal);
  }
Beispiel #2
0
 public ApplicationMain() {
   super();
   terminal = new AsciiPanel();
   terminal.write("RogueLike", 1, 1);
   add(terminal);
   pack();
 }
  public static void displayBorders(int x, int y, int x2, int y2) {
    terminal.write((char) 201, x, y);
    terminal.write((char) 187, x2, y);
    terminal.write((char) 188, x2, y2);
    terminal.write((char) 200, x, y2);

    for (int i = x + 1; i < x2; i++) {
      terminal.write((char) 205, i, y);
      terminal.write((char) 205, i, y2);
    }
    for (int i = y + 1; i < y2; i++) {
      terminal.write((char) 186, x, i);
      terminal.write((char) 186, x2, i);
    }
  }
Beispiel #4
0
 @Override
 public void displayOutput(@NotNull final AsciiPanel terminal) {
   terminal.write(1, 1, "You won.");
   terminal.writeCenter(22, "-- press [enter] to restart --");
 }
Beispiel #5
0
 public void repaint() {
   super.repaint();
   terminal.repaint();
 }
Beispiel #6
0
 public void init() {
   super.init();
   this.setSize(terminal.getWidth() + 20, terminal.getHeight() + 20);
 }
Beispiel #7
0
 public AppletMain() {
   super();
   terminal = new AsciiPanel();
   terminal.write("rl tutorial", 1, 1);
   add(terminal);
 }
 public static void clearArea(int x, int y, int x2, int y2) {
   for (int i = y; i < y2; i++) {
     for (int j = x; j < x2; j++) terminal.write(" ", j, i);
   }
 }
 public static void clearScreen() {
   terminal.clear();
 }