Index / 2016 / Quiz 06 Mission 07
400×300 · p5.js instance mode
Quiz_06_Mission_07.pde 42 lines
int xpos = 0;
int ypos = 110;
int yspeed = 3;
color c1 = #ABDDE5;

void setup() {
  size(400,300);
  background(#ABDDE5);
}

void draw() {
  background(c1);
  
  if (keyPressed) {
    if (key == 'r') {
      c1 = #F02C50;
    } else if (key == 'g') {
      c1 = #;
    } else if (key == 'y') {
      c1 = #F7E86E;
    }
  }
  
  fill(#);
  ellipse(200,150,100,100);
  
  fill(#);
  ellipse(xpos,150,20,20);
  xpos += 1;
  
  fill(#F23D3D);
  rect(160,ypos,80,80);
  ypos += yspeed;
  
  if (ypos >= 220 || ypos <= 0) {
    yspeed = yspeed*-1;
  }
  
  fill(#);
  ellipse(mouseX,mouseY,20,20);
  
}
read-only archive source from /2016/QUIZZES/Q-06 Processing 1/Quiz_06_Mission_07/Quiz_06_Mission_07.pde

Description

This page is generated from the Processing project folder at /2016/QUIZZES/Q-06 Processing 1/Quiz_06_Mission_07/Quiz_06_Mission_07.pde.

Archive

No companion assets were found in this sketch folder.