public void act() { Background b = (Background)getWorld(); List<Point> points = b.getPoints(); for (Point p : points) { for (Point otherp : points) { if (otherp != p) { GreenfootImage lines = new GreenfootImage(1200, 900); lines.setColor(Color.GRAY); lines.drawLine(p.getX(), p.getY(), otherp.getX(), otherp.getY()); setImage(lines); } } } }