|
St.Louis NORMLL | home
Fun Stuff! | Check Out Our Pix | A Special Page.... | Let's "Link up"!! | A Gift From Us To You! | Our Chatroom | Clips | Ganja Ettiquette | Mini Poll | A Tribute To The Fallen Stars...
Fun Stuff!
import java.awt.*;
class eyeimage {
int rectx,recty,cx,cy;
int ipx,ipy; // center of pupil
public eyeimage(int x, int y) {
rectx = x; // x value of eye rectangle left corner
recty = y; // y value of eye rectangle top corner
cx = x+16; // center of eye
cy = y+16; //
}
public void draw(Graphics g, int mousex, int mousey) {
double rx,ry,rr,re,px,py;
int jpx,jpy;
rx = (double)mousex - (double)cx;
ry = (double)mousey - (double)cy;
rr = rx*rx + ry*ry;
rr = Math.sqrt(rr);
if (rr<6) {
jpx = mousex - 9;
jpy = mousey - 9;
} else {
re = 6/rr;
px = (double)cx + rx*re;
py = (double)cy + ry*re;
jpx = (int)px - 9;
jpy = (int)py - 9;
}
if ((ipx==jpx)&&(ipy==jpy)) {
return;
} else {
ipx = jpx;
ipy = jpy;
g.setColor(Color.white);
g.fillOval(rectx, recty, 32, 32);
g.setColor(Color.black);
g.drawOval(rectx, recty, 32, 32);
g.fillOval(ipx, ipy, 20, 20);
}
}
}
public class eyeball extends java.applet.Applet implements Runnable {
int mousex,mousey;
int tailx,taily,tailNum;
int drawi,drawj;
java.awt.Color ltGray;
eyeimage eyes[];
Thread myThread;
int timeout=200;
public void init() {
String at;
int i,j,k;
// Get parameters
at = getParameter("tail_x");
tailx = (at == null) ? 2 : Integer.valueOf(at).intValue();
at = getParameter("tail_y");
taily = (at == null) ? 1 : Integer.valueOf(at).intValue();
tailNum = tailx*taily;
resize(tailx*32, taily*32);
ltGray = new java.awt.Color(64*3,64*3,64*3);
at = getParameter("speed");
timeout = 1000 / ((at == null) ? 4 : Integer.valueOf(at).intValue());
resize(tailx*32, taily*32);
eyes = new eyeimage[tailNum];
for (i=0 ; i
|
||