Is it possible to draw a polyline by passing the method an array list of Point values? something like this:
ArrayList<Point> projectilePoints=new ArrayList<Point>();
Projectile p = new Projectile(11, 17, 73, 37);
for (int i = 0; i < 11; i++) {
Point point = p.getPositionAt(i);
projectilePoints.add(point);
}
g.drawPolyline(projectilePoints, projectilePoints, 11);
What is the correct way to pass in the parameters of x and y points for the polyline?
No, there is no such method takes
ArraylistofPointreference parameter. The Syntax is,Graphics.drawPolyline(int[] xPoints, int[] yPoints, int nPoints)