import java.util.*; public class object90 extends object1{ int old90posx=-1; int old90posy=-1; public object90(){ objnumber=90; methods[0]="hit"; methods[1]="resetevent"; } public void init(Global glbl){ super.init(glbl); if(image==null){ image=global.loadImage(global.Server, global.Directory+"90"+global.Extention, global.show); sound=global.loadSound(global.Server, global.Directory+"90.au"); } int old90pos=global.grid.next(0,0,90); old90posy=old90pos==0?0:old90pos/(global.WIDTH*global.STEPP); old90posx=old90pos%(global.WIDTH*global.STEPP); } public void execute(){ if(method.compareTo("hit")==0) hit(); if(method.compareTo("resetevent")==0) resetevent(); } public void aftermove(){ /* int x,y; x=global.player.getX(); y=global.player.getY(); if(old90posy == y && old90posx < x){ global.grid.setxy(old90posx,old90posy,13); global.boardrow=-1; global.boardcol=-1; global.boardwidth=-1; global.boardheight=-1; global.doboard=true; } */ } public void hit(){ // make player pos = 13 // advance pos on player int x,y; if(global.playsound)sound.play(); x=global.player.getX(); y=global.player.getY(); global.grid.setxy(x,y,13); global.player.set(old90posx,old90posy); global.boardrow=-1; global.boardcol=-1; global.boardwidth=-1; global.boardheight=-1; global.doboard=true; } public void resetevent(){ } }