Lab3 - Movie



float X, Y;

void setup() {

  size(580, 580);
  smooth();
  strokeWeight(3);
  frameRate(60);
}

boolean end_X, end_Y;
void draw() {
  background(0);
  DragonBall(mouseX, mouseY);
}

void DragonBall(float Rx, float Ry) {

  //Value Move//referent point (270,270)
  Rx=Rx-270;
  Ry=Ry-270;
  //outside shadow
  noStroke();
  X=380;
  Y=38;
  for (int A=0; A<=380; A++) {
    fill(A);

    ellipse(280+Rx, 490+Ry, X, Y);
    X--;
    Y=Y-0.1;
  }

  //Big stroke
  stroke(#FF7F00);
  fill(#FFD700);
  ellipse(270+Rx, 270+Ry, 450, 450);

  //background tone
  int ColorB=215;
  for (int posA=400; posA>230; posA--) {
    stroke(255, ColorB, 15);
    ColorB--;
    ellipse(255+Rx, 255+Ry, posA, posA);
  }

  //pure orange
  noStroke();
  fill(#FF8C00);
  ellipse(255+Rx, 255+Ry, 330, 330);

  //inside Shadow
  ColorB=255;
  int C=255;
  for (int posA=280; posA>100; posA--) {
    stroke(255, ColorB, C);
    ColorB--;
    C=C-2;
    ellipse(222+Rx, 222+Ry, posA, posA);

    noStroke();
    fill(#FF8C00);
    ellipse(250+Rx, 250+Ry, 230, 230);
  }
  RSX=Rx;
  RSY=Ry;
  Star(35, 70);
}
float RSX, RSY;

void Star(int Star_width, int Star_height) {
  float StartX;
  float StartY;

  //Star 1 //L up
  StartX = 210+RSX;
  StartY = 185+RSY;

  fill(#CD3700);
  stroke(#CD3700);
  beginShape();
  vertex(StartX, StartY); // Start
  vertex(StartX+(Star_width*0.25), StartY+(Star_height*0.375));
  vertex(StartX+Star_width, StartY+(Star_height*0.375));  //vertex 2  Right
  vertex(StartX+(Star_width/2), StartY+(Star_height*0.625));
  vertex(StartX+(Star_width*0.75), StartY+Star_height);          //vertex 3  Right
  vertex(StartX, StartY+(Star_height*0.75)); // mid
  vertex(StartX-(Star_width*0.75), StartY+Star_height);          //vertex 4  Left
  vertex(StartX-(Star_width/2), StartY+(Star_height*0.625));
  vertex(StartX-Star_width, StartY+(Star_height*0.375));  //vertex 5  Left
  vertex(StartX-(Star_width*0.25), StartY+(Star_height*0.375));

  endShape(CLOSE);

  //Star 2  //R up
  StartX = 320+RSX;
  StartY = 185+RSY;


  fill(#CD3700);
  stroke(#CD3700);
  beginShape();
  vertex(StartX, StartY); // Start
  vertex(StartX+(Star_width*0.25), StartY+(Star_height*0.375));
  vertex(StartX+Star_width, StartY+(Star_height*0.375));  //vertex 2  Right
  vertex(StartX+(Star_width/2), StartY+(Star_height*0.625));
  vertex(StartX+(Star_width*0.75), StartY+Star_height);          //vertex 3  Right
  vertex(StartX, StartY+(Star_height*0.75)); // mid
  vertex(StartX-(Star_width*0.75), StartY+Star_height);          //vertex 4  Left
  vertex(StartX-(Star_width/2), StartY+(Star_height*0.625));
  vertex(StartX-Star_width, StartY+(Star_height*0.375));  //vertex 5  Left
  vertex(StartX-(Star_width*0.25), StartY+(Star_height*0.375));

  endShape(CLOSE);

  //Star 3 //L down
  StartX = 235+RSX;
  StartY = 295+RSY;


  fill(#CD3700);
  stroke(#CD3700);
  beginShape();
  vertex(StartX, StartY); // Start
  vertex(StartX+(Star_width*0.25), StartY+(Star_height*0.375));
  vertex(StartX+Star_width, StartY+(Star_height*0.375));  //vertex 2  Right
  vertex(StartX+(Star_width/2), StartY+(Star_height*0.625));
  vertex(StartX+(Star_width*0.75), StartY+Star_height);          //vertex 3  Right
  vertex(StartX, StartY+(Star_height*0.75)); // mid
  vertex(StartX-(Star_width*0.75), StartY+Star_height);          //vertex 4  Left
  vertex(StartX-(Star_width/2), StartY+(Star_height*0.625));
  vertex(StartX-Star_width, StartY+(Star_height*0.375));  //vertex 5  Left
  vertex(StartX-(Star_width*0.25), StartY+(Star_height*0.375));

  endShape(CLOSE);

  //Star 4 // R down
  StartX = 345+RSX;
  StartY = 295+RSY;

  fill(#CD3700);
  stroke(#CD3700);
  beginShape();
  vertex(StartX, StartY); // Start
  vertex(StartX+(Star_width*0.25), StartY+(Star_height*0.375));
  vertex(StartX+Star_width, StartY+(Star_height*0.375));  //vertex 2  Right
  vertex(StartX+(Star_width/2), StartY+(Star_height*0.625));
  vertex(StartX+(Star_width*0.75), StartY+Star_height);          //vertex 3  Right
  vertex(StartX, StartY+(Star_height*0.75)); // mid
  vertex(StartX-(Star_width*0.75), StartY+Star_height);          //vertex 4  Left
  vertex(StartX-(Star_width/2), StartY+(Star_height*0.625));
  vertex(StartX-Star_width, StartY+(Star_height*0.375));  //vertex 5  Left
  vertex(StartX-(Star_width*0.25), StartY+(Star_height*0.375));

  endShape(CLOSE);
}