Sketch 4

float x = 50.0; // X-coordinate

float y = 50.0; // Y-coordinate

float radius = 30.0; // Radius of the circle

float speedX = 1.0; // Speed of motion on the x-axis

float speedY = 0.4; // Speed of motion on the y-axis

int directionX = 1; // Direction of motion on the x-axis

int directionY = -1; // Direction of motion on the y-axis

float speed = 2.0;

float angle = 0.0;

 

void setup() {

size(500, 500);

smooth();

noStroke();

ellipseMode(RADIUS);

}

 

void draw() {

fill(0, 12);

rect(0, 0, width, height);

 

pushMatrix();

 

fill(280, 0, 15);

translate(300, 300);

angle = angle + 0.001;

rotate(angle);

rect(0, 0, 5, 100);

 

fill(234, 20, 182);

translate(10, 10);

angle = angle + 0.001;

rotate(angle);

rect(0, 100, 5, 150);

 

fill(34, 25, 52);

translate(10, 10);

angle = angle + 0.001;

rotate(angle);

rect(0, 100, 5, 200);

 

fill(246, 55, 126);

translate(10, 10);

angle = angle + 0.001;

rotate(angle);

rect(240, 0, 5, 250);

 

fill(200, 0, 255);

translate(10, 10);

angle = angle + 0.05;

rotate(angle);

rect(50, 100, 5, 300);

popMatrix();

}

32 notes
  1. beckycodes posted this