From 1ebb4814cd8cef4a22cf0b239f7ae9dba8061a16 Mon Sep 17 00:00:00 2001 From: shiffman Date: Fri, 27 Jul 2012 02:37:34 +0000 Subject: [PATCH] updates to PShape examples --- .../Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde b/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde index c201db9c2..534848ae6 100644 --- a/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde +++ b/java/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde @@ -18,10 +18,10 @@ void setup() { smooth(); shapes[0] = createShape(ELLIPSE,0,0,100,100); - shapes[0].fill(0,127); + shapes[0].fill(255,127); shapes[0].stroke(0); shapes[1] = createShape(RECT,0,0,100,100); - shapes[1].fill(0,127); + shapes[1].fill(255,127); shapes[1].stroke(0); shapes[2] = createShape(); shapes[2].fill(0,127); @@ -45,14 +45,14 @@ void setup() { polygons = new ArrayList(); for (int i = 0; i < 25; i++) { - int selection = int(random(2)); // Pick a random index + int selection = int(random(shapes.length)); // Pick a random index Polygon p = new Polygon(shapes[selection]); // Use corresponding PShape to create Polygon polygons.add(p); } } void draw() { - background(255); + background(51); // Display and move them all for (Polygon poly : polygons) {