import java.awt.*;
import java.applet.*;
import java.awt.image.*;
import Raster;
import Playfield;
import Sprite;

  public class Applet_proj1 extends Applet 
{

    Sprite s[];
    Playfield p;
    Image theMan, theAnt, theCrab, output;

                                 
  public void init() 
    {                         
      theMan = getImage(getCodeBase(), "UD_library.jpg");
      theAnt = getImage(getCodeBase(), "Ant.gif"); 
      theCrab = getImage(getCodeBase(), "crab.gif"); 

       
      p = new Playfield(theMan);
      p.addSprite(theAnt);
      p.addSprite(theCrab);      
       
    }
  

    
        public boolean mouseDown(Event e, int x, int y) 
      {
       
      s[0].x=x;
      s[0].y=y;
      s[1].x=x+2*s[0].width;
      s[1].y=y+2*s[0].height;                        
      p.Draw();
      return true;
     }
    
       public void paint(Graphics g) 
       {
        g.drawImage(p.output, 0, 0, this);
       } 
                                   
   }









