Files
processing4/java/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde
2012-12-09 15:35:57 +00:00

31 lines
427 B
Plaintext

/**
* PolygonPShapeOOP.
*
* Wrapping a PShape inside a custom class
*/
// A Star object
Star s1, s2;
void setup() {
size(640, 360, P2D);
smooth();
// Make a new Star
s1 = new Star();
s2 = new Star();
}
void draw() {
background(51);
s1.display(); // Display the first star
s1.move(); // Move the first star
s2.display(); // Display the second star
s2.move(); // Move the second star
}