Skip to content

Instantly share code, notes, and snippets.

@darkwave
Created December 4, 2014 20:38
Show Gist options
  • Save darkwave/357f6258ed6bac37d025 to your computer and use it in GitHub Desktop.
Save darkwave/357f6258ed6bac37d025 to your computer and use it in GitHub Desktop.
Esempi funzioni
void setup() {
size(600, 600);
}
void draw() {
if (isInside(mouseX, mouseY, 300, 300, 50))
fill(#ff0000);
else
fill(#00ff00);
ellipse(300, 300, 100, 100);
int c = somma(4, 5);
}
boolean isInside
(int x, int y, int cX, int cY, int radius) {
boolean result = dist(x, y, cX, cY) < radius;
return result;
}
int somma(int a, int b) {
return a + b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment