mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Getting keyword color up and running
This commit is contained in:
@@ -11,26 +11,23 @@
|
||||
|
||||
float x;
|
||||
float y;
|
||||
float targetX, targetY;
|
||||
float easing = 0.05;
|
||||
|
||||
void setup()
|
||||
{
|
||||
void setup() {
|
||||
size(640, 360);
|
||||
noStroke();
|
||||
}
|
||||
|
||||
void draw()
|
||||
{
|
||||
void draw() {
|
||||
background(51);
|
||||
|
||||
targetX = mouseX;
|
||||
float targetX = mouseX;
|
||||
float dx = targetX - x;
|
||||
if(abs(dx) > 1) {
|
||||
x += dx * easing;
|
||||
}
|
||||
|
||||
targetY = mouseY;
|
||||
float targetY = mouseY;
|
||||
float dy = targetY - y;
|
||||
if(abs(dy) > 1) {
|
||||
y += dy * easing;
|
||||
|
||||
Reference in New Issue
Block a user