Example #1
0
  public void render(int xScroll, int yScroll, Screen screen) {
    screen.setOffset(xScroll, yScroll);
    // From Pixel Precision To Tile P.
    int x0 = xScroll >> 4;
    int x1 = (xScroll + screen.width + 16) >> 4;
    int y0 = yScroll >> 4;
    int y1 = (yScroll + screen.height + 16) >> 4;

    for (int y = y0; y < y1; y++) {
      for (int x = x0; x < x1; x++) {
        getTile(x, y).render(x, y, screen);
      }
    }

    /*
     * Call the Wanderer render Method, which points to the screen's render
     * method, which renders the tile. This render is called every time that
     * the level is rendered
     */
    wand1.render(screen);
  }
Example #2
0
 // AI and changes to the level, entities in the level
 public void update() {
   wand1.wanderAI();
 }