Week 6

by sherly chen
  • Show Code
/** @peep sketch */
float angle = 0.0; 
float speed = 1.50; 
float radius = 150.0; 
float sx = 4.0;
float sy = 4.0;
 
void setup() {
  size(200, 200);
  background(0);
  noStroke();
}
 
void draw() {
  fill(0, 2);
  rect(0, 0, width, height);
  angle += speed; 
  fill(255);
  float x = width/5 + (cos(angle) * radius);
  float y = height/5 + (sin(angle) * radius);
  ellipse(x, y, 10, 10); 
  float x5 = x + cos(angle * sx) * radius / 2;
  float y5 = y + sin(angle * sy) * radius / 2;
  ellipse(x5, y5, 25, 25);
}

Comments

Nobody has said anything yet.