import java.util.*; import java.awt.*; // // FIRE // public class object177 extends object{ private static Random random = new Random(); long randomtime=92342342342342340l; Image image1; Image image2; int listnr=0; int nr=0; int list[]=new int[1000]; public object177(){ methods[0]="hit"; methods[1]="event"; objnumber=177; randomtime=(new Date()).getTime(); } public void execute(){ if(method.compareTo("hit")==0){ hit(); } if(method.compareTo("event")==0){ event(); } return; } public void init(Global glbl){ global=glbl; image1=global.loadImage(global.Server, global.Directory+"177"+global.Extention, global.show); image2=global.loadImage(global.Server, global.Directory+"177_2"+global.Extention, global.show); sound=global.loadSound(global.Server, global.Directory+"177.au"); image=image1; listnr=0; int nr=0; boolean found=false; while(!found){ nr=global.grid.next(nr==0?0:nr%(global.WIDTH*global.STEPP), nr==0?0:nr/(global.WIDTH*global.STEPP),177); if(nr < 0) found=true; else{ // Add the position to the list list[listnr++]=nr; } nr++; } } public void hit(){ // check border global.doreload=true; global.setInfo("You burn"); } public void event(){ Date dd=new Date(); if(dd.getTime() % 1000 > 50 && global.playsound){ sound.play(); } if(randomtime < dd.getTime()) { if(image==image1) image=image2; else image=image1; for(int listn=0; listn