public void drawVisibleMap(Graphics g) { for (Tile t : tiles) { if (t.intersects(display)) { double dx = t.x - display.getX(); double dy = t.y - display.getY(); g.drawImage((Image) (control.getImageAt(t.getImageNumber())), (int) dx, (int) dy, null); } } }
public Color getColorForPoint(Point p) { for (Tile t : tiles) { double dx = t.x - display.getX(); double dy = t.y - display.getY(); Rectangle temp2 = new Rectangle((int) dx, (int) dy, (int) t.getWidth(), (int) t.getHeight()); if (temp2.contains(p)) { int px = (int) (p.x - dx); int py = (int) (p.y - dy); Color c = new Color( ImageControl.getInstance().getShadowImageAt(t.getImageNumber()).getRGB(px, py)); return c; } } return null; }