}
class
Dot
{
float
initX;
float
initY;
currentX;
float
float
currentY;
int
positionRange
float
initSize;
float
currentSize;
int
sizeRange
=
int
initColor;
int
currentColor;
int
ColorRange
float
timer
=
0.0;
float
speed
=
0.06;
Dot(float
x,
float
initX
=
x;
initY
=
y;
currentX
=
currentY
=
initSize
=
currentSize
initColor
=
currentColor
}
void
setSize() {
currentSize
}
void
setPosition() {
currentY
=
}
void
setColor() {
currentColor
}
void
update() {
timer
+=
speed;
}
void
show() {
fill(currentColor, 100, 100);
ellipse(currentX, currentY, currentSize, currentSize);
}
}
Wie es funktioniert?
1.11. Spielen Sie mit der Verarbeitung
=
60;
50;
=
80;
y,
float
s,
int
x;
y;
s;
=
s;
c;
=
c;
=
initSize
+
sizeRange
initY
+
positionRange
=
int(initColor
+
c) {
sin( timer );
*
cos( timer
2);
*
*
ColorRange
sin( timer ));
*
SunFounder Da Vinci Kit
(Fortsetzung der vorherigen Seite)
433