import java.awt.*; import java.applet.*; //import java.util.Collection; //import Spider; public class ANIM3 extends Applet implements Runnable { Thread AnimThread; //private Image OffScreenImage; public Spider Spiders[]; // public Collection ColSpiders[]; private final int NUMOFSPIDERS=5; //********************************************************************************************** public void init() { try { //Spiders[NUMOFSPIDERS]=new Spider(); /* for(int i=0;i400) { x-=Math.abs(movex); chancex=99; //xstate=2; } else { x+=movex; chancex=10; //xstate=3; } if(y<=0) //Check for bounderies and adjust direction\ { y+=Math.abs(movey); chancey=99; //ystate=1; } else if(y>400) { y-=Math.abs(movey); chancey=99; //ystate=2; } else { y+=movey; chancey=10; //ystate=3; } if(delay>=FrameDelay) { delay=0; if(framenum>=2 || framenum<=0) { //frame=0; step*=(-1); framenum+=step; } else framenum+=step; } //if delay else { delay++; }//else delay }//move //********************************************************************************************************************************** public int GetDirectionx() { //Get direction x spider is moving return(dirx); } //********************************************************************************************************************************** public int GetDirectiony() { //Get direction y spider is moving return(diry); } //********************************************************************************************************************************** public int GetFrameNum() { //Get current frame number of animation return(framenum); } //********************************************************************************************************************************** private int GetNewDirection() { //Get new direction for spider to take int num; return(num=(int)(3.0*Math.random())); } //********************************************************************************************************************************** private int MakeDecision() { //Send back a number that is used to determin if spider takes new direction int num; return(num=(int)(100.0*Math.random())); } //********************************************************************************************************************************** public Image GetImage(int frame) { return(Frames[frame]); } //********************************************************************************************************************************** };//Class Spider }//Class Anim3