import java.util.*; import java.awt.*; // // Switch for gate // public class object42 extends object29{ public object42(){ objnumber=42; } public void init(Global glbl){ global=glbl; if(image1==null){ squick=global.loadSound(global.Server, global.Directory+"14.au"); image1=global.loadImage(global.Server, global.Directory+"31"+global.Extention, global.show); image2=global.loadImage(global.Server, global.Directory+"29_1"+global.Extention, global.show); image=image1; } other=global.grid.next(0,0,27); } public void hit(){ if(other > -1){ if(global.playsound) squick.play(); if(global.grid.get(other)==27){ image=image2; global.grid.set(other,1); } else if(global.grid.get(other)==1) { image=image1; global.grid.set(other,27); } } int c=other%(global.WIDTH*global.STEPP); int h=other/(global.WIDTH*global.STEPP); global.boardwidth=-1; global.boardheight=-1; global.boardrow=-1; global.boardcol=-1; global.doboard=true; } }