Hier nochmal der Code als Zip Datei. Hoffe jetzt klappt es…
Author Archives: obasch
Hilfe mein Torwart hält den Ball nicht!
Das Letzte, was mir eigentlich noch fehlt, ist, dass der Ball an der ovalen Ellipse der Torwarte abprallt. Ich hatte einen Code für Pong gefunden, mit dem ich bisschen rumexperimentiert habe bis ich gar nicht mehr wusste, was ich da eigentlich mache…
Hier mein Code:
float Ball = 30;
float Torwart_breite = 60;
float xpos;
float ypos;
float xGeschwindigkeit = 2;
float yGeschwindigkeit = 2;
PFont schrift;
int x = 400;
PImage bild;
boolean goal_check = true;
void setup () {
size (800, 950);
smooth ();
xpos = width / 2;
ypos = height / 2;
schrift = loadFont(“ACaslonPro-Bold-48.vlw”);
textFont (schrift);
}
void draw () {
/*float py = 180+Torwart_breite+Ball;
if(xpos == py
&& ypos > x – Torwart_breite – Ball
&& ypos 5) {xGeschwindigkeit = 5;}
if(xGeschwindigkeit 380-Ball) && ball_dir == 1) {
ball_dir *= -1;
}
if((xpos height -Ball) {
dy = dy * -1;
}
if(ypos 550) {
x = 550 + 0;
}
if (x 675) {
xGeschwindigkeit = xGeschwindigkeit * -1;
}
// rechter Spielfeldrand
if (xpos 780 && (xpos 550)) {
yGeschwindigkeit = yGeschwindigkeit * -1;
}
// oberer Spielfeldrand
if (ypos < 170 && (xpos 550)) {
yGeschwindigkeit = yGeschwindigkeit * -1;
}
// oben Tor
if (ypos 250 && xpos 830 && xpos > 250 && xpos < 550) {
showTor();
}
Danke für die Hilfe… Oliver
}
void keyPressed(){
if (keyCode == ENTER) {
goal_check = true;
}
// Torwart oben
if (keyCode == LEFT) {
x = x – 20;
}
if (keyCode == RIGHT) {
x = x + 20;
}
//Torwart unten
if (keyCode == 'a') {
x = x – 20;
}
if (keyCode == 'd') {
x = x + 20;
}
}
void showTor(){
background(255, 255, 0);
rect(0,0,width,height);
fill (255, 0, 0);
textAlign (CENTER);
textSize (180);
text ("TOR!!!", width/2, height/2);
textSize (80);
text("Enter drücken", width/2, height/1.5);
goal_check = false;
xpos = width / 2;
ypos = height / 2;
}
void show_field(){
background(0);
fill (8, 155, 26);
stroke(255);
strokeWeight (5);
//Spielfeld
beginShape();
vertex (250, 50);
vertex (250, 150);
vertex (100, 150);
vertex (100, 800);
vertex (250, 800);
vertex (250, 900);
vertex (550, 900);
vertex (550, 800);
vertex (700, 800);
vertex (700, 150);
vertex (550, 150);
vertex (550, 50);
endShape(CLOSE);
stroke (255);
line (100, height/2, 700, height/2);
line (100, 150, 700, 150);
line (100, 800, 700, 800);
ellipse (width/2, height/2, 200, 200);
fill (255, 255, 255);
ellipse (width/2, height/2, 30, 30);
noFill();
//Halbkreis oben
beginShape ();
curveVertex (250, 150);
curveVertex (250, 150);
curveVertex (300, 220);
curveVertex (400, 250);
curveVertex (500, 220);
curveVertex (550, 150);
curveVertex (550, 150);
endShape (CLOSE);
//Halbkreis unten
beginShape ();
curveVertex (250, 800);
curveVertex (250, 800);
curveVertex (300, 730);
curveVertex (400, 700);
curveVertex (500, 730);
curveVertex (550, 800);
curveVertex (550, 800);
endShape (CLOSE);
}
void show_Torwart(){
fill(255);
noStroke();
//Torwart oben
fill(255, 0, 0);
ellipse (x , 180, Torwart_breite, 15); // Hier soll der Ball abprallen
fill (255, 255, 0);
ellipse (x, 180, 25, 25);
fill(0);
ellipse (x – 20, 190, 15, 15);
fill(0);
ellipse (x + 20, 190, 15, 15);
//Torwart unten
fill(255, 255, 0);
ellipse (x , 770, Torwart_breite, 15); // Hier soll der Ball abprallen
fill(0);
ellipse (x, 770, 25, 25);
fill(0);
ellipse (x – 20, 760, 15, 15);
fill(0);
ellipse (x + 20, 760, 15, 15);
}
Michael Jackson’s Handschuh mal anders
http://whiteglovetracking.com/
On May 4th, 2007, we asked internet users to help isolate Michael Jackson’s white glove in all 10,060 frames of his nationally televised landmark performance of Billy Jean. 72 hours later 125,000 gloves had been located. wgt_data_v1.txt is the culmination of data collected. It is released here for all to download and use as an input into any digital system. Just as the data was gathered collectively it is our hope that it will be visualized collectively. Please email links to your apps, video, source code, and/or screen shots to evan[at]eyebeam[dot]org. Work will be exhibited in an online gallery and depending on popularity and interest potentially in a forthcoming physical gallery exhibition as well. Huge thanks to everyone that contributed to the data collection.

