public class Bird2 { // Frames/pictures of the bird in various poses public static final java.awt.Image[] images = new java.awt.Image[8]; float x, y; // bird's coordinate on the screen float speed; // bird's speed in pixel movements per frame int currentFrame; // current frame of the bird public Bird2(float bx, float by) { x = bx; y = by; speed = (float)(Math.random()*10 + 5); // random speed from 5 to 15 pixels/frame currentFrame = (int)(Math.random()*8); // start with a random picture // Load up all 8 pictures for this bird for (int i=1; i<=8; i++) images[i-1] = java.awt.Toolkit.getDefaultToolkit().createImage("Birdx" + i + ".gif"); } }