

import java.awt.*;
import java.applet.*;


public class Lunch extends Applet implements Runnable
{
    int rowCount = 0;
    MediaTracker tracker;
    int mscore;
    int buckCount = 0;
    boolean firstDraw = true;
    String scoreString;
    Color back;
    int timer;
    int imggone;
    int fscore;
    boolean gameover;
    int imgNum = 16;
    int buckNum = 2;
    int score;
    int cow;
    Image offscrImg;
    Graphics og;
    Image funFact;
    Image img[] = new Image[imgNum];
    dragable drag[] = new dragable[imgNum];
    bucket buck[] = new bucket[buckNum];
    Image buckimg[] = new Image[buckNum];
    int counter[] = new int[5];
    String Instructions;
    String is[] = new String[5];

    String endMessage[] = new String[11];
    String loadMessage[] = new String[5];
    String itemMessage[] = new String[18];
    bucket again;
    bucket nextRow;
    Image nextImage;

    Image startAgain;
    String s;
    Thread runme;
    boolean show;
    boolean containerPick = true;
    int px;
    int py;
    int pw;
    int ph;
    int mult;

    int qx;
    int qy;
    int qw;
    int qh;

    int rx;
    int ry;
    int rw;
    int rh;

    int sx;
    int sy;
    int loopcount;
    int a = 5;
    int b = 255;
    int c = 255;
    int d = 255;
    int e = 0;
    int f  = 0;
    int h, lmc;


    int funx = -200;
    int funy = -200;
    boolean funyes = false;
    boolean jiggle = false;

    int selbuck;
    boolean cowoncan = false;
    boolean tempb = true;




    public void start()
    {

        //if(!tracker.checkID(0))
        //{

           runme = new Thread(this);
           runme.start();


        //}

    }

    public void stop()
    {

        runme.stop();
        runme = null;

    }


    public void run()
    {
        while(!show)
        {
           try{
              runme.sleep(100);
           }catch(InterruptedException e){}
           

           if(tracker.checkID(0, true))
           {
              show = true;
              firstDraw = true;

           }
           repaint();


        }


        




    }

    public void reInit()
    {
       rowCount = -1;
       containerPick = true;
       
       mscore = 10;
       imggone = 0;
       gameover = false;
       timer = 0;
       score = 0;
       cow = 0;
       scoreString = "";
       Instructions = is[0];

       loopcount = 0;
       for(int buckCount = 0; buckCount < buckNum; buckCount++)
       {
           buck[buckCount].reset();
       }

       for(int imgCount = 0; imgCount < imgNum; imgCount++)
       {
          drag[imgCount].reset();
       }

       setNextRow();


    }

	public void init()
	{

	   containerPick = true;
       mscore = 10;
       scoreString = "";
       timer = 0;
       gameover = false;
       score = 0;
       cow = 0;

       show = false;
       firstDraw = true;
       imggone = 0;
       px = 100;
       py = 100;
       pw = 100;
       ph = 100;
       mult = 50;

       qx = 150;
       qy = 150;
       qw = 100;
       qh = 100;

       rx = 200;
       ry = 200;
       rw = 100;
       rh = 100;

       sx = 200;
       sy = 200;
       loopcount = 0;






       endMessage[0] = "CONGRATULATIONS! You were left with no trash.";
       endMessage[1] = "GREAT WORK! Only scraps and recyclables left over.";
       endMessage[2] = "GOOD START to a trash free lunch.";
       endMessage[3] = "Review the 3 R's before you pack your real lunch.";

       itemMessage[0] = "lunch box: 0";
       itemMessage[1] = "paper bag: 5";
       itemMessage[2] = "thermos of drink: 0";
       itemMessage[3] = "can of soda: 1";
       itemMessage[4] = "juice box: 5";
       itemMessage[5] = "drink in glass bottle: 1";
       itemMessage[6] = "chips in plastic container: 0";
       itemMessage[7] = "piece of fruit: 0";
       itemMessage[8] = "snack size bag  of chips: 5";
       itemMessage[9] = "plastic yogurt cup: 5";
       itemMessage[10] = "ravioli in tin container: 1";
       itemMessage[11] = "sandwich in plastic container: 0";
       itemMessage[12] = "hard boiled egg: 0";
       itemMessage[13] = "sandwich in plastic bag: 5";
       itemMessage[14] = "pudding in tin cup: 1";
       itemMessage[15] = "cookies in plastic container: 0";
       itemMessage[16] = "fruit in tin cup: 1";
       itemMessage[17] = "candy bar: 5";


       loadMessage[0] = "Recycling can save the planet!";
       loadMessage[1] = "Wait for the Trashless Lunch Game!";
       loadMessage[2] = "Don't go away it's loading!";
       loadMessage[3] = "This game is FUN!";;
       loadMessage[4] = "Reduce Reuse and Recycle!";

       is[0] = "Choose a sack";
       is[1] = "Pick a drink";
       is[2] = "Drag a snack";
       is[3] = "Grab some lunch";
       is[4] = "Take a dessert";
       Instructions = is[0];




	    tracker = new MediaTracker(this);

	    back = new Color(62, 64, 208);
	    offscrImg = createImage(size().width, size().height);

	    again = new bucket(0, size().height-79, 77, 79);
	    startAgain = getImage(getDocumentBase(), "graphics/startagainlunch.gif");
	    tracker.addImage(startAgain, 0);


        nextImage = getImage(getDocumentBase(), "graphics/next.gif");
	    tracker.addImage(nextImage, 0);
	    nextRow = new bucket(-100, -100, 72, 57);

        //can.repaint();



	    buckimg[0] = getImage(getDocumentBase(), "graphics/lunchbox.gif");
	    tracker.addImage(buckimg[0], 0);
	    buckimg[1] = getImage(getDocumentBase(), "graphics/bag.gif");
        tracker.addImage(buckimg[1], 0);



	    buck[0] = new bucket(115, size().height-150, 168, 150);
	    buck[1] = new bucket(320, size().height-173, 130, 173);



        img[0] = getImage(getDocumentBase(), "graphics/thermos.gif");
        tracker.addImage(img[0], 0);
        drag[0] = new dragable(0, -200, -200, 60, 110, 0);


        img[1] = getImage(getDocumentBase(), "graphics/soda.gif");
        tracker.addImage(img[1], 0);
        drag[1] = new dragable(1, -200, -200, 37, 70, 1);


        img[2] = getImage(getDocumentBase(), "graphics/juicebox.gif");
        tracker.addImage(img[2], 0);
        drag[2] = new dragable(2, -200, -200, 50, 60, 5);


        img[3] = getImage(getDocumentBase(), "graphics/sportdrink.gif");
        tracker.addImage(img[3], 0);
        drag[3] = new dragable(3, -200, -200, 39, 94, 1);


        img[4] = getImage(getDocumentBase(), "graphics/chipstup.gif");
        tracker.addImage(img[4], 0);
        drag[4] = new dragable(4, -200, -200, 110, 80, 0);


        img[5] = getImage(getDocumentBase(), "graphics/apple.gif");
        tracker.addImage(img[5], 0);
        drag[5] = new dragable(5, -200, -200, 80, 81, 0);


        img[6] = getImage(getDocumentBase(), "graphics/chips.gif");
        tracker.addImage(img[6], 0);
        drag[6] = new dragable(6, -200, -200, 62, 80, 5);



        img[7] = getImage(getDocumentBase(), "graphics/yogurt.gif");
        tracker.addImage(img[7], 0);
        drag[7] = new dragable(7, -200, -200, 76, 85, 5);

        img[8] = getImage(getDocumentBase(), "graphics/ravioli.gif");
        tracker.addImage(img[8], 0);
        drag[8] = new dragable(8, -200, -200, 85, 80, 1);


        img[9] = getImage(getDocumentBase(), "graphics/tupperwaresandwich.gif");
        tracker.addImage(img[9], 0);
        drag[9] = new dragable(9, -200, -200, 120, 82, 0);


        img[10] = getImage(getDocumentBase(), "graphics/egg.gif");
        tracker.addImage(img[10], 0);
        drag[10] = new dragable(10, -200, -200, 50, 65, 0);


        img[11] = getImage(getDocumentBase(), "graphics/bagsandwich.gif");
        tracker.addImage(img[11], 0);
        drag[11] = new dragable(11, -200, -200, 130, 69, 5);


        img[12] = getImage(getDocumentBase(), "graphics/pudding.gif");
        tracker.addImage(img[12], 0);
        drag[12] = new dragable(12, -200, -200, 80, 80, 1);


        img[13] = getImage(getDocumentBase(), "graphics/cookies.gif");
        tracker.addImage(img[13], 0);
        drag[13] = new dragable(13, -200, -200, 110, 78, 0);

        img[14] = getImage(getDocumentBase(), "graphics/fruitcup.gif");
        tracker.addImage(img[14], 0);
        drag[14] = new dragable(14, -200, -200, 82, 80, 1);

        img[15] = getImage(getDocumentBase(), "graphics/chocolate.gif");
        tracker.addImage(img[15], 0);
        drag[15] = new dragable(15, -200, -200, 69, 34, 5);









	}




    public void update(Graphics g)
    {
        paint(g);

    }

    void clip(Graphics g, int oldx, int oldy, int newx, int newy, int width, int height)
    {

        int x = Math.min(oldx, newx);
        int y = Math.min(oldy, newy);
        int w = (Math.max(oldx, newx) + width) - x;
        int h = (Math.max(oldy, newy) + height) - y;
        g.clipRect(x, y, w, h);

    }

    public void paint(Graphics g)
    {




       if(show)
       {


           og = offscrImg.getGraphics();


           og.setColor(back);
           og.fillRect(0, 0, size().width, size().height);




           og.setColor(Color.white);


           if(containerPick)
           {
                og.drawImage(buckimg[0], buck[0].getX(), buck[0].getY(), buck[0].getW(), buck[0].getH(), this);
                og.drawImage(buckimg[1], buck[1].getX(), buck[1].getY(), buck[1].getW(), buck[1].getH(), this);

           }else{

                og.drawImage(buckimg[buckCount], buck[buckCount].getX(), buck[buckCount].getY(), buck[buckCount].getW(), buck[buckCount].getH(), this);
           }

           for(int imgCount = 0; imgCount < imgNum; imgCount++)
           {
               og.drawImage(img[imgCount], drag[imgCount].getX(), drag[imgCount].getY(), drag[imgCount].getW(), drag[imgCount].getH(), this);
           }


          int inc = 1;

          og.setFont(new Font("Dialog", Font.BOLD, 12));
          if(rowCount != -1)
          {
            for(int x = 0; x < rowCount; x++)
            {

                 og.drawString(itemMessage[counter[x]], 10, (15 * inc) + 5);
                inc++;
            }
          }

          if(!gameover)
          {
            og.setFont(new Font("Dialog", Font.BOLD, 24));
            og.setColor(Color.orange);
            og.drawString(Instructions, 180, 30);
          }
          else
           {
            og.setFont(new Font("Dialog", Font.BOLD, 12));
            Instructions = "";
            inc = 1;
            for(int x = 0; x < 5; x++)
            {

                 og.drawString(itemMessage[counter[x]], 10, (15 * inc) + 5);
                inc++;
            }


                 /*
                 if(score <= 0)
                 {

                   score = 0;

                 }else{

                   fscore = (int)(score * 120)/timer;

                 }

              fscore *= 2;
              fscore += 40;
              if(fscore >= 100)
                 fscore = 100;


              */

              scoreString = "YOUR FINAL SCORE IS " + String.valueOf(score);
              if(score <= 0)
              {
               mscore = 0;
              }else if(score <= 4 && score >= 1)
              {
               mscore = 1;
              }else if(score <= 9 && score >= 5)
              {
                mscore = 2;
              }else{
                mscore = 3;
              }
              og.setFont(new Font("Dialog", Font.BOLD, 15));
              og.setColor(Color.orange);
              og.drawString(endMessage[mscore], 120, 160);




              gameover = false;


           }

           og.drawImage(nextImage, nextRow.getX(), nextRow.getY(), this);

           og.setColor(Color.pink);
           og.setFont(new Font("Dialog", Font.BOLD, 24));

           og.drawString(scoreString, 130, 130);


           og.drawImage(startAgain, again.getX(), again.getY(), again.getW(), again.getH(),this);
           og.setFont(new Font("Dialog", Font.BOLD, 18));
           og.setColor(Color.yellow);
           //og.drawString("Time: " + String.valueOf(timer), 21, 110);

           og.drawString("Points: " + String.valueOf(score), 18, 225);



           if(funyes)
           {
               og.drawImage(funFact, funx, funy, this);
               og.drawImage(funFact, funx + 398, funy, this);

               if(tempb)
               {
                 funx += 2;
                 funy -= 2;
                 tempb = false;

               }else{
                 funx -= 2;
                 funy += 2;
                tempb = true;

               }

           }



           if(firstDraw)
           {
              g.drawImage(offscrImg, 0, 0, this);

           }else{

              firstDraw = false;
              for(int imgCount = 0; imgCount < imgNum; imgCount++)
              {


                  if(dragable.draglock == imgCount)
                  {
                      clip(og, drag[imgCount].lastMouseX, drag[imgCount].lastMouseY, drag[imgCount].getX(), drag[imgCount].getY(), drag[imgCount].getW(), drag[imgCount].getH());

                  }

              }


              g.drawImage(offscrImg, 0, 0, this);

           }



       }else{


           if(firstDraw)
           {
              g.setColor(back);
              g.fillRect(0, 0, size().width, size().height);
              firstDraw = false;
           }

           mult = (int)(Math.random() * 10 );
           if(px < 1)
           {
              px += mult;
           }else if(px > 300){
              px -= mult;
           }else{
              if(mult < 5)
              {
                 px -= (int)(Math.random() * 10 );
              }else{
                px += (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(py < 1)
           {
              py += mult;
           }else if(py > 300){
              py -= mult;
           }else{
              if(mult < 5)
              {
                 py += (int)(Math.random() * 10 );
              }else{
                py -= (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(ph < 10)
           {
              ph += mult;
           }else if(ph > 200){
              ph -= mult;
           }else{
              if(mult < 5)
              {
                 ph += (int)(Math.random() * 10 );
              }else{
                ph -= (int)(Math.random() * 10 );
              }
           }


           mult = (int)(Math.random() * 10 );
           if(pw < 10)
           {
              pw += mult;
           }else if(pw > 200){
              pw -= mult;
           }else{
              if(mult < 5)
              {
                 pw -= (int)(Math.random() * 10 );
              }else{
                pw += (int)(Math.random() * 10 );
              }
           }








           mult = (int)(Math.random() * 10 );
           if(qx < 1)
           {
              qx += mult;
           }else if(qx > 300){
              qx -= mult;
           }else{
              if(mult < 5)
              {
                 qx += (int)(Math.random() * 10 );
              }else{
                qx -= (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(qy < 1)
           {
              qy += mult;
           }else if(qy > 300){
              qy -= mult;
           }else{
              if(mult < 5)
              {
                 qy += (int)(Math.random() * 10 );
              }else{
                qy -= (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(qh < 10)
           {
              qh += mult;
           }else if(qh > 300){
              qh -= mult;
           }else{
              if(mult < 5)
              {
                 qh -= (int)(Math.random() * 10 );
              }else{
                 qh += (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(qw < 10)
           {
              qw += mult;
           }else if(qw > 300){
              qw -= mult;
           }else{
              if(mult < 5)
              {
                 qw -= (int)(Math.random() * 10 );
              }else{
                qw += (int)(Math.random() * 10 );
              }
           }








                      mult = (int)(Math.random() * 10 );
           if(rx < 1)
           {
              rx += mult;
           }else if(rx > 300){
              rx -= mult;
           }else{
              if(mult < 5)
              {
                 rx += (int)(Math.random() * 10 );
              }else{
                rx -= (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(ry < 1)
           {
              ry += mult;
           }else if(ry > 300){
              ry -= mult;
           }else{
              if(mult < 5)
              {
                 ry += (int)(Math.random() * 10 );
              }else{
                ry -= (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(rh < 10)
           {
              rh += mult;
           }else if(rh > 300){
              rh -= mult;
           }else{
              if(mult < 5)
              {
                 rh -= (int)(Math.random() * 10 );
              }else{
                rh += (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(rw < 10)
           {
              rw += mult;
           }else if(rw > 300){
              rw -= mult;
           }else{
              if(mult < 5)
              {
                 rw -= (int)(Math.random() * 10 );
              }else{
                rw += (int)(Math.random() * 10 );
              }
           }







           mult = (int)(Math.random() * 10 );
           if(rw < 10)
           {
              rw += mult;
           }else if(rw > 300){
              rw -= mult;
           }else{
              if(mult < 5)
              {
                 rw -= (int)(Math.random() * 10 );
              }else{
                 rw += (int)(Math.random() * 10 );
              }
           }



           mult = (int)(Math.random() * 10 );
           if(sy < 100)
           {
              sy += mult;
           }else if(sy > 200){
              sy -= mult;
           }else{
              if(mult < 5)
              {
                 sy += (int)(Math.random() * 10 );
              }else{
                sy -= (int)(Math.random() * 10 );
              }
           }

           mult = (int)(Math.random() * 10 );
           if(sx < 100)
           {
              sx += mult;
           }else if(sx > 200){
              sx -= mult;
           }else{
              if(mult < 5)
              {
                 sx += (int)(Math.random() * 10 );
              }else{
                sx -= (int)(Math.random() * 10 );
              }
           }




          if(mult <= 3)
          {
             g.setColor(Color.pink);
             g.drawOval(rx, ry, rw, rh);
             g.setColor(Color.green);
             g.drawOval(qx, qy, qw, qh);
             g.setColor(Color.red);
             g.drawOval(px, py, pw, ph);

          }else if(mult <= 6 && mult > 3){
            g.setColor(Color.pink);
            g.drawOval(rx, ry, rw, rh);
            g.setColor(Color.red);
            g.drawOval(px, py, pw, ph);
            g.setColor(Color.green);
            g.drawOval(qx, qy, qw, qh);

          }else{
            g.setColor(Color.red);
            g.drawOval(px, py, pw, ph);
            g.setColor(Color.pink);
            g.drawOval(rx, ry, rw, rh);
            g.setColor(Color.green);
            g.drawOval(qx, qy, qw, qh);


          }

            loopcount++;
            if(loopcount > 15)
            {
               loopcount = 0;
               a = (int)(Math.random() * 36);
               b = (int)(Math.random() * 255);
               c = (int)(Math.random() * 255);
               d = (int)(Math.random() * 255);
               e = (int)(Math.random() * 255);
               f = (int)(Math.random() * 255);
               h = (int)(Math.random() * 255);
               lmc = (int)(Math.random() * 5);


            g.setFont(new Font("Dialog", Font.BOLD, 42));

            g.setColor(new Color(e, f, h));

            g.fillOval(46, 96, 407, 148);

            g.setColor(new Color( b, c, d));

            g.fillOval(50, 100, 400, 141);
            g.setColor(new Color(e, f, h));
            g.drawString("Please Wait!", 110, 160);
            g.setFont(new Font("Dialog", Font.BOLD, 15));
            g.drawString(loadMessage[lmc], 130, 200);
            }



       }

    }


    public void setNextRow()
    {
        rowCount++;

        if(containerPick)
        {
            //drag[0].x =  50;
            //drag[0].y = 100;
            //drag[1].x = 280;
            //drag[1].y = 80;
            //imggone += 2;
        }
        else{

            int times = 70;
            for(int count = imggone; count < imggone + 4; count ++)
            {


                drag[count].x = times + 50;
                times += drag[count].w;
                drag[count].y = 90;

            }

            nextRow.x = -200;
            nextRow.y = -200;
        }

    }


    public boolean mouseUp(Event e, int x, int y)
    {

      if(containerPick)
      {

        if(buck[0].IsInside(x, y))
        {
            score += 0;
            containerPick = false;
            buck[0].x = 210;
            buck[1].x = -200;
            buck[1].y = -200;
            buckCount = 0;
            Instructions = is[rowCount+1];
            counter[0] = 0;
            setNextRow();
        }
        if(buck[1].IsInside(x, y))
        {
           score += 5;
           containerPick = false;
           buck[1].x = 210;
           buck[0].x = -200;
           buck[0].y = -200;
           buckCount = 1;
           Instructions = is[rowCount+1];
           counter[0] = 1;
           setNextRow();
        }


      }else{



            for(int imgCount = 0; imgCount < imgNum; imgCount++)
            {
                if(drag[imgCount].IsInside(x, y))
                {

                    if(buck[buckCount].IsInside(x, y))
                    {

                        score += drag[imgCount].InOut;
                        cowoncan = true;

                        funx = 5;
                        funy = 10;
                        //funyes = true;
                        //jiggle = true;

                        counter[rowCount] = imgCount+2;







                        //drag[imgCount].setPos(-100, -100);
                        for(int count = imggone; count < imggone + 4; count ++)
                        {

                            drag[count].x = -200;
                            drag[count].y = -200;

                        }
                        imggone += 4;

                        if(imgNum == imggone)
                        {
                            gameover = true;
                            firstDraw = true;
                        }

                        if((imggone % 4) == 0 && !gameover)
                        {
                            //nextRow.x = 250;
                            //nextRow.y = 125;
                            Instructions = is[rowCount+1];
                            setNextRow();
                        }


                    }



                }

            }



      }// end containerPick else

      repaint();

      return true;

    }

    public boolean mouseDown(Event e, int x, int y)
    {


        funyes = false;
        jiggle = false;
        repaint();

        for(int imgCount = 0; imgCount < imgNum; imgCount++)
        {
            if(drag[imgCount].IsInside(x, y))
            {
                 drag[imgCount].setMouseDown(x, y);
            }
        }

        if(again.IsInside(x, y))
          reInit();
        return true;

    }

    int dragc = 0;

    public boolean mouseDrag(Event e, int x, int y)
    {


        dragc++;
        if(dragc == 4)
        {
            dragc=0;
        }
        cow = 0;
        for(int imgCount = 0; imgCount < imgNum; imgCount++)
        {
            if(drag[imgCount].IsInside(x, y))
            {
                drag[imgCount].setPos(x, y);
                if(dragc == 3)
                {
                    repaint();
                }
            }
        }



        return true;

    }

}


class dragable extends bucket
{

    public static int draglock;
    public int InOut, lastMouseX, lastMouseY, id;

    dragable(int id, int x, int y, int w, int h, int InOut)
    {

        super(x, y, w, h);
        this.InOut = InOut;
        this.id = id;
    }


    void setMouseDown(int downX, int downY)
    {

          draglock = id;
          lastMouseX = downX;
          lastMouseY = downY;


    }
    void setPos(int newMouseX, int newMouseY)
    {

        if(draglock == id)
        {
           x += newMouseX - lastMouseX;
           y += newMouseY - lastMouseY;

           lastMouseY = newMouseY;
           lastMouseX = newMouseX;
        }

    }


}

class bucket
{


    public int x, y, w, h;
    public int ox, oy, ow, oh;

    bucket(int x, int y, int w, int h)
    {

        this.x = x;
        this.y = y;
        this.w = w;
        this.h = h;
        ox = x;
        oy = y;
        ow = w;
        oh = h;
    }

    void reset()
    {
        x = ox;
        y = oy;
        w = ow;
        h = oh;

    }

    int getW()
    {
       return w;
    }

    int getH()
    {
       return h;
    }

    int getX()
    {
       return x;
    }

    int getY()
    {
       return y;
    }

    boolean IsInside(int mx, int my)
    {

        if(mx >= x && mx < (x + w) && my >= y && my <= (y + h))
        {

            return true;

        }else{

            return false;

        }

    }

}

class myCan extends Canvas
{

    private String curString;
    int x, y;
    Color mblue;
    //boolean rb;
    int ccount = 0;

    Color carr[] = new Color[6];


    myCan(int w, int h)
    {

        carr[0] = new Color(170, 70, 170);
        carr[1] = new Color(255, 255, 255);
        carr[2] = new Color(250, 150, 50);
        carr[3] = new Color(225, 25, 25);
        carr[4] = new Color(25, 25, 225);
        carr[5] = new Color(0, 0, 0);
        //resize(w, h);
        resize(290, 40);
        mblue = new Color(70, 170, 70);
        //mred = new Color(170, 70, 70);
        //rb = true;


    }


    public void setCan(String s)
    {

        curString = s;
        x = 10;
        y = 20;
        ccount++;
        if (ccount > 5)
        {
            ccount = 0;
        }
        //rb = !rb;


    }

    public void scroll(int amount)
    {

        x -= amount;
        this.repaint();


    }

    public void update(Graphics g)
    {

        this.paint(g);

    }

    public void paint(Graphics g)
    {
        //if(rb)
        //{
           //g.setColor(mblue);
        //}else{
           //g.setColor(mred);
        //}




    }



}


