//  Applet to do animation with gif's,
//  but now uses mouse to move item in image. 
//  This is done WITHOUT double-buffering - note "flashes"
//  Note also that the moose has transparent background.

import java.applet.*;   		// applet classes
import java.awt.*;			// user interface classes
import java.awt.event.*;		// event handling classes
import java.lang.*;			// contains Math class
import java.io.*;

public class animate3 extends Applet {

	Image background, moose;

	int new_x = 50;
	int new_y = 70;

	public void paint (Graphics g) {
		int j;

		g.drawImage (background, 35, 60, this);
		g.drawImage (moose, new_x, new_y, this);

	}  // paint


	public void init () {
		int i;

		background = getImage (getDocumentBase(), "mountlogo0.gif");
		moose = getImage (getDocumentBase(), "transMoose.gif");

		// follow mouse (from Just Java, p. 579)
		addMouseMotionListener (new MouseMotionListener () {
			public void mouseDragged (MouseEvent e) {
				new_x = e.getX();
				new_y = e.getY();
				repaint ();
			}
			public void mouseMoved (MouseEvent e) {}
		} );

	}  // init

}  // program
