Robert Strahlen

RobertIbisch

Ziel dieser Übung war es eine Vielzahl von Strahlen bewegen zu lassen.

 

int a=619;
int b=204;
int i;
int j;
PFont myFont;

void setup(){
  size(640,480);
  noCursor();
  myFont = createFont(PFont.list()[30],18);
  textFont(myFont);
  fill(200);
}

void draw(){

  background(255);

  for (int i =0 ;i <641; i =i+20+a){
    for (int j=30;j 619){
        a=619;
      }
      else{
        a = a + 10;
      }
    }

    if (keyCode == LEFT) {
      if (a  449){
        b=459;
      }
      else{
        b = b + 10;
      }
    }

    if (keyCode == UP) {
      if (b < 0){
        b= 0;
      }
      else{
        b = b - 10;
      }
    }
  }
  println (b);
}

void drawHalfWay(int theX, int theY){
  int myHalfX=getAverage(mouseX, theX);
  int myHalfY=getAverage(mouseY, theY);

  line(theX,theY, myHalfX, myHalfY);
}

int getAverage(int theA, int theB){
  int myHalfWay = ( (theA+theB) / 2);
  return myHalfWay;

}