show code
void setup () {
size (800, 600);
}
int rayon = 25;
float positionX = 0;
float positionY = 0;
float deltaX;
float deltaY;
void draw () {
background (0);
deltaX = mouseX - positionX;
deltaY = mouseY - positionY;
positionX = positionX + deltaX * .1;
positionY = positionY + deltaY * .1;
ellipse (positionX, positionY, rayon, rayon);
}
Laisser un commentaire