Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Drop {
- float x = random(width*2);
- float y = random(-300, -100);
- float z = random(0, 30);
- float len = map(z, 0, 20, 19, 20);
- float yspeed = map(z, 15, 20, 8, 10);
- void fall() {
- y = y+ yspeed;
- float grav = map(z, 0, 20, 0, 0.2);
- yspeed = yspeed + grav;
- if ( y > height) {
- y = random(-200, -100);
- yspeed = map(z/4, 0, 20, 4, 10);
- }
- }
- void show() {
- float thick = map(z, 0, 40, 2, 3);
- strokeWeight(thick/2);
- stroke(mouseX, random(43, 230), mouseY);
- line(x-y, y+len, x-y+z*2, y-23);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement