if you are planning to draw more stars you can put that rotating and translating in your function and simply draw your stars by writing Star(x,y);
Code:float xpos;
float ypos;
int sz;
float angle;
void setup() {
frameRate(12);
size(400,400);
smooth();
xpos =0;
ypos = 0;
sz = width/8;
}
void draw() {
background(0xFF006600);
angle += PI/24;
Star(20,150);
Star(120,70);
Star(230,150);
Star(150,20);
Star(width/2,height/2);
}
void Star(float x, float y) {
pushMatrix();
fill(0xFFFF0000);
noStroke();
translate(x,y);
rotate(-angle);
beginShape();
vertex(-12.0, -12.0);
bezierVertex(-12.0, -12.0, -12.0, -12.0, -12.0, -12.0);
bezierVertex(-12.0, -12.0, 0.0, -31.0, 0.0, -31.0);
bezierVertex(0.0, -31.0, 6.0, -14.0, 6.0, -14.0);
bezierVertex(6.0, -14.0, 22.0, -7.0, 23.0, -7.0);
bezierVertex(24.0, -7.0, 5.0, 8.0, 5.0, 8.0);
bezierVertex(5.0, 8.0, 0.0, 30.0, 0.0, 30.0);
bezierVertex(0.0, 30.0, -11.0, 7.0, -11.0, 7.0);
bezierVertex(-11.0, 7.0, -31.0, -8.0, -31.0, -8.0);
bezierVertex(-31.0, -8.0, -13.0, -11.0, -13.0, -11.0);
endShape();
popMatrix();
}
i know my star sucks