Einblick in die generative Gestaltung mit «Processing»

Sechs Kursabende à vier Stunden an der EB Zürich

Kurskonzeption und Leitung Hanna Züllig


< back

						/*
Autorin: Salome Rinderknecht
Kurs: Einblick in die generative Gestaltung mit processing ip971231
Kursleitung: Hanna Zuellig
Veroeffentlicht unter der creative common license Attribution-NonCommercial-ShareAlike
CC BY-NC-SA  http://creativecommons.org/licenses/
*/

float x = 50;
float y = 100;
float xspeed = 5;
float yspeed = 4;
int xRadius = 10;
int yRadius = 10;
int xdirection = 1;
int ydirection = 1;


void setup() {
 size(500,500);
 smooth();
 noFill();
 strokeWeight(5); 
 ellipseMode(RADIUS);
  
  
}


void draw() {
  
  x += xspeed * xdirection;
  y += yspeed * ydirection;
  
  if ((x > width - xRadius) || (x < xRadius)) {
    xdirection = -xdirection;
    
  }
  
  if ((y > height - yRadius) || (y < yRadius)) {
    ydirection = -ydirection;
    
  }
  
  ellipse(x,y,xRadius,yRadius); 
  
  
  if(mousePressed){
    saveFrame("Salome_b.png");
    
  }
}