mirror of
https://github.com/dyne/FreeJ.git
synced 2026-02-06 04:59:16 +01:00
processing-js 0.4 has been merged in some relevant parts basic and topic scripts added for test color handling fixed, more scripts show up now
31 lines
384 B
Plaintext
31 lines
384 B
Plaintext
float x;
|
|
float y;
|
|
float targetX, targetY;
|
|
float easing = 0.05;
|
|
|
|
void setup()
|
|
{
|
|
size(200, 200);
|
|
smooth();
|
|
noStroke();
|
|
}
|
|
|
|
void draw()
|
|
{
|
|
background( 51 );
|
|
|
|
targetX = mouseX;
|
|
float dx = mouseX - x;
|
|
if(abs(dx) > 1) {
|
|
x += dx * easing;
|
|
}
|
|
|
|
targetY = mouseY;
|
|
float dy = mouseY - y;
|
|
if(abs(dy) > 1) {
|
|
y += dy * easing;
|
|
}
|
|
|
|
ellipse(x, y, 33, 33);
|
|
}
|