import java.awt.*;
public class fallingletter extends basicletter //does all the methods in basicletter still, but allows interaction
{
protected int xoffset, yoffset; //used to track how far off they clicked originally and drags relative to that
//constructor to do the same thing as the constructor for basicletter
public fallingletter(char newletter, int newx, int newy)
{
super(newletter, newx, newy);
}
//called by mouseClicked in the applets, randomly assigns the color as it did in the constructor for basicletter
public void changeColor()
{
int r=0, g=0, b=0;
while (r == 0 && g == 0 && b == 0)
{
r = (int)(Math.random()*2);
g = (int)(Math.random()*2);
b = (int)(Math.random()*2);
}
color = new Color(r*255, g*255, b*255);
}
//checks if a point is inside this letter, note: the coordinates of the letter when we're drawing it (using drawString()) are at the *bottom left* corner of the letter.
public boolean clickedin(Point clickpoint)
{
if (clickpoint.x>x-5 && clickpoint.xy-35 && clickpoint.y