public class fire extends java.applet.Applet implements Runnable {
boolean first=true;
int ROWS = 50;
int COLS = 64;
int HIDDEN = 4;
int ROWS_SEED = 4;
int ROWS_RESEED = 48;
int MAX_SEED = 8;
int PALETTE_SIZE = 64;
int COOLING_LIMIT = 32;
int COOLING_ROWS = 42;
int COOLING_FACTOR = 2;
java.awt.Color palette[] = new java.awt.Color[PALETTE_SIZE];
byte Buffer[],Buffer2[];
String message,textfont;
int textsize,textX,textY;
Color textcolor;
Image offScrImage=null;
Graphics offScrGC;
Dimension offScrSize;
Thread kicker=null;
public String getAppletInfo() {
return "Fire applet by Javier Rodriguez <jrodrig@data.net.mx>";
}
// Place fire bubble on click
public boolean mouseDown(java.awt.Event evt, int x, int y) {
int i;
i=x+y*COLS;
if(i>81) {
Buffer[i]=(byte)255;
Buffer[i-COLS]=(byte)255;
Buffer[i+COLS]=(byte)255;
Buffer[i-1]=(byte)255;
Buffer[i+1]=(byte)255;
}
return true;
}
public Color hexColor(String hex, Color std) {
try {
Integer rgb=new Integer(0);
hex.replace('#',' ');
hex.trim();
rgb=Integer.valueOf(hex,16);
return new Color(rgb.intValue());
} catch (Exception e) {
return std;
}
}
}