randomly, or using the mouse input, or using the frame counter (your choice). The completed program should be saved. You should submit the code you created a file "Lab Submission 1.pde"
void setup ()
{
size(400, 400); // create window
fill(255,255,255);
}
void draw () {
background(0,0,0);
fill(255,255,255);
textSize(45);
fill(random(255),random(255),random(255)); // text
text("RIGHT CLICK MOUSE", 10, 200);
if (mousePressed) {
background(0,0,0);
fill(255,255,255);
ellipse(50,25,100,100);
ellipse(100,85,40,40);
fill(random(255),random(255),random(255));
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10); // balls
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
ellipse(frameRate=(random(500)),frameRate=(random(399)),10,10);
// UFO
fill (0,255,0);
ellipse(mouseX-10,mouseY-10,100,20);
fill(255,255,0);
arc(mouseX-10,mouseY-10,100,20,PI/1,TWO_PI);
fill(255,255,255);
ellipse(mouseX-50, mouseY-7,3,3);
ellipse(mouseX-40, mouseY-6,3,3);
ellipse(mouseX-30, mouseY-5,3,3);
ellipse(mouseX-20, mouseY-4,3,3);
ellipse(mouseX-10, mouseY-3,3,3);
ellipse(mouseX, mouseY-3,3,3);
ellipse(mouseX+10, mouseY-4,3,3);
ellipse(mouseX+20, mouseY-5,3,3);
ellipse(mouseX+30, mouseY-6,3,3);
fill(255,0,70); // red ground
rect(0,250,500,500);
fill(128,128,128); // road
rect(0,250,500,50);
fill(255,255,255); //white lines
rect(0,270,50,10);
rect(75,270,50,10);
rect(150,270,50,10);
rect(225,270,50,10);
rect(300,270,50,10);
rect(375,270,50,10);
fill(188,188,188); //rover
rect(frameCount%800-300,200,150,50,60); // base
rect(frameCount%800-160,175,10,50,60); // camera stick X
rect(frameCount%800-160,170,25,5,5); //camera stick Y
fill(80,80,80);
rect(frameCount%800-300,200,150,20,30);
fill(0,0,255);
rect(frameCount%800-290,190,25,25,30); // solar panels
rect(frameCount%800-255,190,25,25,30); // solar panels
rect(frameCount%800-220,190,25,25,30); // solar panels
rect(frameCount%800-185,190,25,25,30); // solar panels
fill(255,255,255);
ellipse(frameCount%800-140,170,10,10); // camera ball
fill(0,0,0);
ellipse(frameCount%800-300,250,35,35); // back tyre
ellipse(frameCount%800-160,250,35,35); // back tyre
fill( 188,188,188);
ellipse(frameCount%800-300,250,25,25); // interior wheel (back)
ellipse(frameCount%800-160,250,25,25); // interior wheel
fill(0,0,0);
ellipse(frameCount%800-270,250,35,35); // front tyre
ellipse(frameCount%800-190,250,35,35); // front tyre
fill( 188,188,188);
ellipse(frameCount%800-270,250,25,25); // interior wheel (front)
ellipse(frameCount%800-190,250,25,25); // interior wheel
}
}
Step by step
Solved in 2 steps with 1 images