mirror of
https://github.com/processing/processing4.git
synced 2026-01-30 03:41:15 +01:00
27 lines
302 B
Plaintext
27 lines
302 B
Plaintext
/**
|
|
* PolygonPShapeOOP.
|
|
*
|
|
* Wrapping a PShape inside a custom class
|
|
*/
|
|
|
|
|
|
// A Star object
|
|
Star s;
|
|
|
|
void setup() {
|
|
size(640, 360, P2D);
|
|
smooth();
|
|
// Make a new Star
|
|
s = new Star();
|
|
|
|
}
|
|
|
|
void draw() {
|
|
background(51);
|
|
// Display the star
|
|
s.display();
|
|
// Move the star
|
|
s.move();
|
|
}
|
|
|