/* COUNTDOWN.java - Produces turtle with numbers
   Created by Randel W McGirr
   blackturtle.us 2012
*/
import java.awt.*;
import java.applet.*;
import java.util.*;

public class COUNTDOWN extends Applet implements Runnable{

  Dimension d;
  Image offI;
  CDTURT turt;
  int cycle, inc, curr, cnt, ccc;
  int body, fleg, bleg;
  Thread tt;

  public void init(){
    d = getSize();
    turt = new CDTURT(d.width, d.height, 20);
    offI = createImage(d.width, d.height);
    tt = new Thread(this);
    tt.start();
  }
  
  public void run(){
     while(true){
       repaint(); 
       try{ 
         Thread.sleep(500); 
       }catch(InterruptedException ie){ } 
    }
  }

  public void update(Graphics g){
    paint(g);
  }

  public void paint(Graphics g){
    Graphics og = offI.getGraphics();
    og.setColor(new Color(ccc,ccc,0));
    og.fillRect(0,0,d.width,d.height);
    turt.draw(og);
    g.drawImage(offI, 0, 0, this);
    og.dispose();
  }
}
//<applet code=COUNTDOWN.class height=900 width=1100></applet>
