GMU:Processing im Park/Maike Effenberg/HW2

From Medien Wiki
< GMU:Processing im Park‎ | Maike Effenberg
Revision as of 21:55, 13 January 2016 by Bhgvt (talk | contribs) (Created page with "== Code - Homework 2 == <source lang = "java"> PImage img; int dx= 5; int dy = 500; void setup() { size(500, 700); img = loadImage("bild2.jpg"); image(img, 0, 0, widt...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Code - Homework 2

 
PImage img;
int dx= 5;
int dy = 500;
void setup() {
  
  size(500, 700);
   img = loadImage("bild2.jpg");
  image(img, 0, 0, width, height);
      

      
color c = get(50, 350);
fill(c);
noStroke();

float y =50;
boolean flag = true;
for (float x = 40; x < 260; x+=11 ){
  
  if (flag)
  {y+=10;}
  else  {
    y -=10;
}

if (y == 80){
flag = false;
}
if (y == 50){
flag = true;
}
  rect(x, y, dx, dy);
  
  }
}