703
edits
Line 189: | Line 189: | ||
} | } | ||
ball[i].maleBall(); | ball[i].maleBall(); | ||
} | |||
} | |||
</source> | |||
== Ball == | |||
<source lang="Java">class Ball { | |||
int g1,g2; //Größe | |||
float x,y; //Position | |||
int h,s,b,a; //Farbe | |||
float vx,vy; //Geschwindigkeit | |||
float angle; //Gradzahl | |||
float[] position = new float[4]; // die 4 Ecken des Balls; | |||
Ball() { | |||
g1 = 60; | |||
g2 = g1; | |||
s = 100; | |||
b = 100-g1; | |||
a = 100; | |||
angle = 90; | |||
} | |||
void maleBall() { | |||
for (int i=0; i<g1; i+=5) { //Abrundungen bzw. Schatten | |||
fill(h,s,b+i,a); | |||
ellipse(x,y,g1-i,g2-i); | |||
} | |||
} | } | ||
} | } | ||
</source> | </source> |
edits