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"

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
By using Processing(4.2.1)
Write
a program
that animates a small object of your own design, (e.g. a bee, boat, car,
plane etc).
The object should be made from different coloured primitives. The object should move,
either
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"
Transcribed Image Text:By using Processing(4.2.1) Write a program that animates a small object of your own design, (e.g. a bee, boat, car, plane etc). The object should be made from different coloured primitives. The object should move, either 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"
Expert Solution
lab1.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
 
 
 

}
}

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY