Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float radius = 35;
- float x;
- float y;
- float direction;
- void setup() {
- fullScreen();
- pixelDensity(displayDensity());
- background(255);
- strokeWeight(2);
- x = width/2;
- y = height/2;
- direction = 0;
- }
- void draw() {
- direction = direction + random(-1.3, 1.3);
- x = x + 10 * cos(direction);
- y = y + 10 * sin(direction);
- if (x > width + radius) {
- x = -radius;
- }
- if (x < -radius) {
- x = width + radius;
- }
- if (y > height + radius) {
- y = -radius;
- }
- if (y < -radius) {
- y = height + radius;
- }
- float diameter = 2 * radius;
- float a = random(6);
- if (a < 1) {
- fill(221, 188, 210); // Pinkie pie
- } else if (a < 2) {
- fill(238, 239, 243); // Rarty
- } else if (a < 3) {
- fill(199, 165, 229); // Twlith sparkle
- } else if (a < 4) {
- fill(236, 189, 103); // Applejack
- } else if (a < 5) {
- fill(253, 248, 176); // Flutter shy
- } else {
- fill(180, 218, 255); // Rainbow dash
- }
- ellipse(x, y, diameter, diameter);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement