//cmk 4/27/08 PFont font; float angleA = 0.0; float angleB = 0.0; // Current angle float speed = 0.025; // Speed of motion float radius = 200.0; // Range of motion float sx = 1.0; float sy = 0; float inc = 0.01; float offset = 200; float scaleVal = 10.0; float angleInc = PI/20.0; void setup() { size(600, 700); smooth(); font = loadFont("AmericanTypewriter-CondensedLight-32.vlw"); textFont(font); noCursor(); } void draw() { noStroke(); fill(150, 200, 0, 4); //background colors rect(0, 0, width, 200); fill(95, 195, 227, 20); rect(0, 200, 600, height); fill(255, 24, 24);//flitting font textSize(16); text("hummingbird", random(-500, 600), random(-20, 200)); //moving circle angleA += speed; float sinval = sin(angleA); // Set the position of the small circle based on new float cosval = cos(angleA); // values from sine and cosine float x = 300 + (cosval * radius); float y = 300 + (sinval * radius); fill(255); ellipse(x, y, 3, 3); //stones fill(220, 24, 24, 100); smooth(); ellipse(20,695, 10,10); ellipse(380,695, 10,10); ellipse(120,695, 30,30); ellipse(420,695, 10,10); ellipse(580,695, 40,40); //flowers stroke(148, 73, 232, 10); //seaweed inc += 0.001; //speed of movement float angle = sin(inc)/10.0 + sin(inc*1.2)/20.0; tail(48, 3, angle*3); tail(68, 9, angle/1.3); tail(118, 9, angle/1.3); tail(118, 9, angle/1.3); tail(133, 22, angle); tail(144, 10, angle/1.3); tail(162, 10, angle); tail(188, 17, angle*2); tail(362, 5, angle); tail(388, 12, angle*2); tail(548, 3, angle*3); } void tail(int x, int units, float angle) { pushMatrix(); translate(x, 695); for (int i = units; i > 0; i--) { strokeWeight(i); line(0, 0, 0, -8); translate(0, -8); rotate(angle); } popMatrix(); // top of water stroke(148, 73, 232, 10); fill(95, 195, 227, 20); beginShape(TRIANGLE_STRIP); for (int t = 0 ; t <= width+5; t += 5) { float g = sin(angleB) * scaleVal; if ((t % 3) == 0) { // Every other time through the loop (changes shapes of insides) vertex(t, offset + g); } else { vertex(t, offset - g); } angleB += angleInc; } endShape(); }