mirror of
https://github.com/processing/processing4.git
synced 2026-02-02 21:29:17 +01:00
31 lines
427 B
Plaintext
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
|
|
|
|
}
|
|
|